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(); } }
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(); } } }