void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { other.gameObject.SetActive(false); winText.text = "Congratulation" + "\n" + "You Lose!!"; menuMenager.ShowMenu(menuShow); } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.Escape)) { menuMenager.ShowMenu(menuShow); } if (Input.GetKeyDown(KeyCode.P)) { if (a == 1) { Time.timeScale = 0; a = 0; } else if (a == 0) { Time.timeScale = 1; a = 1; } } }
void setCrystalText() { crystalText.text = "Crystals: " + crystal; if (crystal == 0) { winText.text = "Congratulation!!!" + "\n" + "Score: " + count.ToString(); menuMenager.ShowMenu(menuShow); if (count > highScore) { PlayerPrefs.SetInt(highScoreKey, count); PlayerPrefs.Save(); } } }