Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function UpdateTimerText()
- {
- //update the textfield
- textfield.text = currentTime.ToString();
- Debug.Log("Updating timer");
- }
- function TimerTick()
- {
- while(currentTime > 0)
- {
- Debug.Log("I'ma herp a derp!");
- //wait for 1 second
- yield WaitForSeconds(1);
- //reduce the time
- currentTime--;
- UpdateTimerText();
- }
- Debug.Log("The Current Time is : " + currentTime);
- if(currentTime < 0 )
- {
- Debug.Log("Loading Level....");
- Application.LoadLevel("Scene3");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement