public void ToMainMenu() { this.clickSound.Play(); OnMainMenu?.Invoke(); this.ammoBar.SetActive(false); GameManager.Instance.sentry.gameObject.SetActive(false); sentryArc.SetActive(false); GameManager.Instance.isGameActive = false; GameManager.Instance.tutorialStarted = false; GameManager.Instance.rankTimer.PauseTimer(); GameManager.Instance.rankTimer.gameObject.SetActive(false); introCutsceneAnimator.SetBool("MainMenuClicked", true); introCutsceneAnimator.SetBool("InitiatedGame", false); introCutsceneAnimator.SetBool("SufficientlyCalibrated", false); BreathingManager.calibrationKeys.Clear(); CutsceneManager.calibrated = false; if (Metronome.metronomeStarted == false) { StartCoroutine(Metronome.StartMetronome()); } else if (Metronome.metronomePaused) { Metronome.ToggleMetronomePause(); } CutsceneManager.StartCutscene(); GameManager.Instance.StartGameFromTutorial(); DisableGameOver(); DisableVictory(); Color titleImageColor = this.titleImage.color; this.titleImage.color = new Color(titleImageColor.r, titleImageColor.g, titleImageColor.b, 1.0f); ContinueGame(); Metronome.UpdateMetronomeTempo(80); }
private void PauseGame() { if (IsGamePaused() == true) { return; } pauseMenuItems2.SetActive(true); GameManager.Instance.isGameActive = false; Time.timeScale = 0.0F; Metronome.ToggleMetronomePause(); }