Advertisement
Caminhoneiro

Tempo

Feb 7th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. public bool start;
  2.     float nonTimedTime;
  3.     public float actualTime;
  4.     public Respawner respawnRef;
  5.  
  6.     void Update()
  7.     {
  8.         if (start)
  9.             actualTime = Time.time - nonTimedTime;
  10.         else
  11.             nonTimedTime = Time.time;
  12.  
  13.         if (actualTime > 120)
  14.             respawnRef.GameOver();
  15.             StartCoroutine(EndGame());
  16.  
  17.     }
  18.  
  19.     IEnumerator EndGame()
  20.     {
  21.         yield return new WaitForSeconds(10f);
  22.        // Application.LoadLevel(Application.loadedLevel);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement