playMaker

Author Topic: Count Down Timer Using NGUI & Playmaker  (Read 5938 times)

gamedivision

  • Full Member
  • ***
  • Posts: 227
Count Down Timer Using NGUI & Playmaker
« on: October 24, 2012, 04:17:56 PM »
Im starting to learn little by little here is a countdown timer i made during my lunch,i have five states a listener that waits for a send event,the four other states are 3,2,1,go,each state has a set property to the ngui label with the relevant number,and a send event with a delay of 1 second for each.
once it reaches the go go go event,it flies back to the listener with a set property to the ngui with no text,waiting for another send event for whatever that is (say a start of the game)but i put the set property in the listener to remove any visible text,that way i know for sure its removed.

my question is this,is this way over the top and i just don't understand playmaker.or not bad but there is a better way of doing it.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Count Down Timer Using NGUI & Playmaker
« Reply #1 on: October 26, 2012, 01:46:07 AM »
Hi,

 Indeed, I think it can be optimized, for example, what if you know you need to count dowmnfrom 10, or 3, or 100... this would not turn out very flexible.

 instead, have a in variable representing the count down, and an float variable representing the time between each count, and create a simple looping state logic.

 I have attached a working scene.

bye,

 Jean