|
Ok, what I'm trying to do is make a count down timer that will start, at maybe 2 minutes, at the start of the game, and when It reaches 0:00 then some text will appear on the screen. I know how to do the text and how to start it, but I don't know how to make the actual timer, any Ideas? P.S. I did check out the other two questions about counters and timers, but i couldn't do anything with that :/
(comments are locked)
|
|
I got a simple version of a countdown timer here. I'm sure there are other and more elegant versions out there (e.g. see this forum thread), but they are also a bit lengthy. See for yourself. I changed the code so it doesn't have rounding problems anymore. It should now display correctly; also when changing the minutes.
Feb 22 '10 at 10:46 AM
runevision ♦♦
Thanks for that. Much appreciated :)
Feb 22 '10 at 11:00 AM
Sebas
also you can move variable declarations from OnGUI to the top to prevent unneeded allocations and deallocations
Feb 22 '10 at 11:33 AM
Ashkan_gc
Thank you so much, this has really helped :)
Feb 22 '10 at 03:46 PM
Will
Thanks mate, I was looking for this.
Apr 15 '10 at 03:00 PM
Nom
(comments are locked)
|
|
there are many ways to do this. for example another way would be
(comments are locked)
|
|
so how did you sort the rounding problem?? nevermind i got it all you need to do is change some variables. if anyone needs this in c# here you go :) you will need to change public CountDownSeconds in the inspector to any value of your choice ie, 10:00, you would write 600 in the inspector panel. `using UnityEngine; using System.Collections;
(comments are locked)
|
