I have seen many different timers that I can implement here and on the forums, but I am having an issue understanding how to make the timers start and stop when I want and not from when I run the game. If I write a timer class and attach it to a game object, it starts counting immediately. How do I stop that? I need to also be able to configure the time each time I want to start and stop this timer.
The Unity3D supplied class called Time has a property called “time” which is the number of seconds since the start of the game. This clock keeps on ticking and ticking. You can use this to implement your own timers …
For example, if you want to wake up in 10 seconds then have some logic that reads:
var wakeUpTime:float = Time.time + 10.0;
and then in an Update() function use
if (Time.time >= wakeUpTime)
{
...
}
This gives you ultimate flexibility to do what ever you want to do,