Example #1
0
    public void EndGame()
    {
        scoreUI.gameObject.SetActive(false);
        gameOverUI.gameObject.SetActive(true);

        if (PlayerStats.score > PlayerStats.best)
        {
            gameOverUI.ShowNewBestScore();
            PlayerStats.best = PlayerStats.score;
            PlayerPrefs.SetInt("best", PlayerStats.best);
            PlayerPrefs.Save();
        }

                #if (UNITY_ANDROID)
                #else
        iOSHapticFeedback.Instance.Trigger(iOSHapticFeedback.iOSFeedbackType.Failure);
                #endif
        GameAnalytics.NewProgressionEvent(GAProgressionStatus.Complete, "game", PlayerStats.score);

        DeathCounter.counter++;

        if (!secondChance)
        {
            secondChanceObject.SetActive(true);
        }
    }
Example #2
0
    public void EndGame()
    {
        gameIsOver = true;

        gameUI.gameObject.SetActive(false);
        gameOverUI.gameObject.SetActive(true);

        if (PlayerStats.score > PlayerStats.best)
        {
            gameOverUI.ShowNewBestScore();
            PlayerStats.best = PlayerStats.score;
            PlayerPrefs.SetInt("best", PlayerStats.best);
            PlayerPrefs.Save();
        }
    }