Exemple #1
0
        public void GameOver()
        {
            GameManager._instance.SaveHighScore((int)_scoreFloat);

            GameManager._instance.UpdateCoins((int)(_scoreFloat * (_coinMultiplier * _eventMultiplier)));

            PlayerPrefs.SetInt("CoinsEarned", (int)(_scoreFloat * (_coinMultiplier * _eventMultiplier)));
#if UNITY_ANDROID
            if (GooglePlayGamesScript.CheckIfLoggedIn() == true)
            {
                GooglePlayGamesScript.AddScoreToLeaderboard(GPGSIds.leaderboard_highest_score, (long)_scoreFloat);
            }
#endif
        }
Exemple #2
0
    // This funciton is used to refresh the highscore text.
    private void UpdateHighscoreText()
    {
        _highscoreDisplayText.text = "Highscore: " + PlayerPrefs.GetInt("Highscore").ToString();
        _previousDisplayText.text  = "Previous score: " + PlayerPrefs.GetInt("PreviousScore").ToString();;
        _gemsDisplayText.text      = "Gems earned: " + _gemsEarned.ToString();
        _coinsDisplayText.text     = "Coins earned: " + PlayerPrefs.GetInt("CoinsEarned").ToString();

        _GM.UpdateGems(_gemsEarned);


    #if UNITY_ANDROID
        GooglePlayGamesScript.IncrementAchievement(GPGSIds.achievement_kicking_noob, _numOfBounces);
        GooglePlayGamesScript.IncrementAchievement(GPGSIds.achievement_kicking_novice, _numOfBounces);
    #endif
    }
    public void ShowLeaderboards()
    {
#if UNITY_ANDROID
        GooglePlayGamesScript.ShowLeaderboardsUI();
#endif
    }
    public void ShowAchievements()
    {
#if UNITY_ANDROID
        GooglePlayGamesScript.ShowAchievementsUI();
#endif
    }