Пример #1
0
 // Update is called once per frame
 void Update()
 {
     if (!started && Input.GetButton("Restart"))
     {
         started = true;
         textUpdater.StartCoroutine("countdown_timer");
     }
     if (Input.GetButton("Restart") && finished)
     {
         SceneManager.LoadScene("Race");
     }
     if (player1.current_lap > 3 && !finished)
     {
         finished = true;
         winner   = player1.id;
     }
     else if (player2.current_lap > 3 && !finished)
     {
         finished = true;
         winner   = player2.id;
     }
 }