Advertisement
irishstorm

Untitled

Apr 2nd, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function UpdateTimerText()
  2. {
  3. //update the textfield
  4. textfield.text = currentTime.ToString();
  5. Debug.Log("Updating timer");
  6. }
  7.  
  8.  
  9. function TimerTick()
  10. {
  11. while(currentTime > 0)
  12. {
  13. Debug.Log("I'ma herp a derp!");
  14. //wait for 1 second
  15. yield WaitForSeconds(1);
  16. //reduce the time
  17. currentTime--;
  18.  
  19. UpdateTimerText();
  20. }
  21.  
  22. Debug.Log("The Current Time is : " + currentTime);
  23. if(currentTime < 0 )
  24. {
  25. Debug.Log("Loading Level....");
  26. Application.LoadLevel("Scene3");
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement