Exemplo n.º 1
0
    void updateLightCount()
    {
        lightCountText.text = LitLights.ToString() + "/" + TotalLights.ToString() + " Eyes Open";
        if (LitLights == TotalLights)
        {
            if (GameObject.FindWithTag("Music") != null)
            {
                GameObject.FindWithTag("Music").BroadcastMessage("PlayWinMusic");
            }

            Time.timeScale      = 0f;
            lightCountText.text = "Level Complete";
            CheckCurrentLevel();
            restart.ToggleOn();
        }
    }
Exemplo n.º 2
0
 void OnTriggerEnter(Collider other)
 {
     if (gameover == false)
     {
         if (other.gameObject.CompareTag("DeadZone"))
         {
             GameOver();
             if (GameObject.FindWithTag("Music") != null)
             {
                 GameObject.FindWithTag("Music").BroadcastMessage("PlayLoseMusic");
             }
             Time.timeScale = 0f;
             restart.ToggleOn();
         }
     }
 }