Advertisement
irishstorm

DFGHJKLJHGFDS

Apr 2nd, 2013
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. function UpdateTimerText()
  2. {
  3. //update the textfield
  4. textfield.text = currentTime.ToString();
  5. }
  6.  
  7.  
  8. function TimerTick()
  9. {
  10. //while there are seconds left
  11. while(currentTime > 0)
  12. {
  13. //wait for 1 second
  14. yield WaitForSeconds(1);
  15. //reduce the time
  16. currentTime--;
  17.  
  18. UpdateTimerText();
  19. }
  20.  
  21. if(Countdown_Timer.currentTime ==0 )
  22. GameOver();
  23.  
  24. }
  25.  
  26. function GameOver()
  27. {
  28. Application.LoadLevel("Scene3");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement