void Update() { if (CurrentDelayedButtonAction != DelayedButtonAction.None && !ButtonClickSound.isPlaying) { bool shouldContinuePlayBackground = false; switch (CurrentDelayedButtonAction) { case DelayedButtonAction.Start: SceneManager.LoadScene("GameScene"); break; case DelayedButtonAction.HighScores: SceneManager.LoadScene("HighScoreScene"); break; case DelayedButtonAction.Options: OptionsMenu.Open(); shouldContinuePlayBackground = true; break; case DelayedButtonAction.Exit: Application.Quit(); break; } CurrentDelayedButtonAction = DelayedButtonAction.None; if (shouldContinuePlayBackground) { BackgroundMusic.Play(); } } }
public void ExitButtonClick() { CurrentDelayedButtonAction = DelayedButtonAction.Exit; AnyButtonClicked(); }
public void OptionsButtonClick() { CurrentDelayedButtonAction = DelayedButtonAction.Options; AnyButtonClicked(); }
public void HighScoresButtonClick() { CurrentDelayedButtonAction = DelayedButtonAction.HighScores; AnyButtonClicked(); }
public void StartGameButtonClick() { CurrentDelayedButtonAction = DelayedButtonAction.Start; AnyButtonClicked(); }