public void YouWin()
    {
        m_currentGameState = GameState.YouWin;
        SetCurrentHolder(m_youWinHolder);
        m_backgroundMusic.Stop();
        m_backgroundMusic.clip = m_menuMusic;
        m_backgroundMusic.loop = true;
        m_backgroundMusic.Play();
        AudioAnalyzer.Instance.Stop();

        // GameOver Stuff
        if (OnGameOver != null)
        {
            OnGameOver.Invoke();
        }
    }
Example #2
0
 //End game.
 private void GameOver()
 {
     gameOver?.Invoke(_score);
     if (!PlayerPrefs.HasKey("highScore") || _score > PlayerPrefs.GetInt("highScore"))
     {
         PlayerPrefs.SetInt("highScore", _score);
     }
 }