Exemple #1
0
    private void Finish()
    {
        endScoreText.text = $"Score     <b>{score}";

        if (PlayerPrefs.HasKey("bestScore"))
        {
            if (PlayerPrefs.GetInt("bestScore") < score)
            {
                PlayerPrefs.SetInt("bestScore", score);
                PlayGamesScript.PostScoreToLeaderboard(score);
            }
        }
        else
        {
            PlayerPrefs.SetInt("bestScore", score);
            PlayGamesScript.PostScoreToLeaderboard(score);
        }

        StartCoroutine(gameController.End());
    }