Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function UpdateTimerText()
- {
- //update the textfield
- textfield.text = currentTime.ToString();
- }
- function TimerTick()
- {
- //while there are seconds left
- while(currentTime > 0)
- {
- //wait for 1 second
- yield WaitForSeconds(1);
- //reduce the time
- currentTime--;
- UpdateTimerText();
- }
- if(Countdown_Timer.currentTime ==0 )
- GameOver();
- }
- function GameOver()
- {
- Application.LoadLevel("Scene3");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement