예제 #1
0
    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();
            }
        }
    }
예제 #2
0
 public void ExitButtonClick()
 {
     CurrentDelayedButtonAction = DelayedButtonAction.Exit;
     AnyButtonClicked();
 }
예제 #3
0
 public void OptionsButtonClick()
 {
     CurrentDelayedButtonAction = DelayedButtonAction.Options;
     AnyButtonClicked();
 }
예제 #4
0
 public void HighScoresButtonClick()
 {
     CurrentDelayedButtonAction = DelayedButtonAction.HighScores;
     AnyButtonClicked();
 }
예제 #5
0
 public void StartGameButtonClick()
 {
     CurrentDelayedButtonAction = DelayedButtonAction.Start;
     AnyButtonClicked();
 }