Exemplo n.º 1
0
 public void Pause()
 {
     player.SetActive(false);
     LocalTimer.StopTime();
     gameMenu.SetActive(false);
     pauseMenu.SetActive(true);
 }
Exemplo n.º 2
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         other.gameObject.SetActive(false);
         LocalTimer.StopTime();
         int   allTime    = timer.GetComponent <LocalTimer>().timeForLevel * 100;
         float timePassed = LocalTimer.fixedTime() * 100f;
         int   score      = allTime - (int)timePassed;
         endMenu.SetActive(true);
         gameMenu.SetActive(false);
         var text = endMenu.transform.Find("EndScoreText").gameObject;
         if (text != null)
         {
             text.GetComponent <Text>().text = "Score: " + score.ToString();
         }
     }
 }