public void pauseGame() { if (!gamePaused) { Time.timeScale = 0f; GoodBreathText.alpha0(); BadBreathText.alpha0(); } else { Time.timeScale = 1f; } GameObject.FindWithTag("Player").GetComponent <EggControl>().enabled = gamePaused; gamePaused = !gamePaused; }
// Update is called once per frame void Update() { // When game is over if (gameIsOver == true) { gameOverMenuUI.SetActive(true); if (!playedSound) { SoundControl.playGameOverSound(); GoodBreathText.alpha0(); BadBreathText.alpha0(); playedSound = true; } } else { gameOverMenuUI.SetActive(false); playedSound = false; } }
// Update is called once per frame void Update() { // When game is over if (gameIsOver) { gameOverMenuUI.SetActive(true); if (!playedSound) { SoundControl.playGameOverSound(); GoodBreathText.alpha0(); BadBreathText.alpha0(); playedSound = true; } } else { gameOverMenuUI.SetActive(false); playedSound = false; } /*if (gameIsOver) * { * if (FizSession.sets > 0) * { * HealthControl.lives = FizSession.breaths; * FizSession.sets--; * SceneManager.LoadScene("Game"); * LevelGenerator.spawnPosY = -3.8f; * } * else * { * SceneManager.LoadScene("MainMenu"); * } * gameIsOver = false; * }*/ }