Beispiel #1
0
    public static void ResetAchivements()
    {
#if UNITY_IOS
        GameCenterPlatform.ResetAllAchievements((resetResult) => {
            Debug.Log((resetResult) ? "Reset done." : "Reset failed.");
        });
#elif UNITY_ANDROID
#endif
    }
    // THE UI BELOW CONTAINING GUI BUTTONS IS USED TO DEMONSTRATE THE GAME CENTER INTEGRATION
    // HERE, YOU ARE ABLE TO:
    // (1) VIEW LEADERBOARDS
    // (2) VIEW ACHIEVEMENTS
    // (3) SUBMIT HIGH SCORE TO LEADERBOARD
    // (4) REPORT ACHIEVEMENTS ACQUIRED
    // (5) RESET ACHIEVEMENTS.
    void OnGUI()
    {
        // COLUMN 1
        // SHOW LEADERBOARDS WITHIN GAME CENTER
        if (GUI.Button(new Rect(20, 20, 200, 75), "View Leaderboard"))
        {
            Social.ShowLeaderboardUI();
        }

        // SHOW ACHIEVEMENTS WITHIN GAME CENTER
        if (GUI.Button(new Rect(20, 100, 200, 75), "View Achievements"))
        {
            Social.ShowAchievementsUI();
        }

        // SET GAME OVER SWITCH
        if (GUI.Button(new Rect(20, 180, 200, 75), "Game Over Switch"))
        {
            // ONCE TRUE, THE UPDATE WILL HIT AND HIGH SCORE WILL BE SUBMITTED
            gameOver = true;
        }

        // RESET ALL ACHIEVEMENTS
        if (GUI.Button(new Rect(20, 260, 200, 75), "Reset Achievements"))
        {
            GameCenterPlatform.ResetAllAchievements((resetResult) => {
                Debug.Log(resetResult ? "Achievements have been Reset" : "Achievement reset failure.");
            });
        }

        // COLUMN 2
        // ENABLE ACHIEVEMENT 1
        if (GUI.Button(new Rect(225, 20, 200, 75), "Report Achievement 1"))
        {
            ReportAchievement(achievement1Name, 100.00);
        }

        // ENABLE ACHIEVEMENT 2
        if (GUI.Button(new Rect(225, 100, 200, 75), "Report Achievement 2"))
        {
            ReportAchievement(achievement2Name, 100.00);
        }

        // ENABLE ACHIEVEMENT 3
        if (GUI.Button(new Rect(225, 180, 200, 75), "Report Achievement 3"))
        {
            ReportAchievement(achievement3Name, 100.00);
        }

        // ENABLE ACHIEVEMENT 4
        if (GUI.Button(new Rect(225, 260, 200, 75), "Report Achievement 4"))
        {
            ReportAchievement(achievement4Name, 100.00);
        }
    }
Beispiel #3
0
    ///<summary> ios dev use only </summary>
    public static void ResetAchievements()
    {
#if UNITY_IOS
        string[] keysStr = new string[achievements.Count];
        achievements.Keys.CopyTo(keysStr, 0);

        for (int i = 0; i < keysStr.Length; i++)
        {
            PlayerPrefs.SetFloat(Social.localUser.id + keysStr[i], 0.0f);
            achievements[keysStr[i]].percentCompleted = 0.0;
        }

        GameCenterPlatform.ResetAllAchievements((resetResult) => {
        });
#endif
    }
Beispiel #4
0
        public static void ResetAchievments()
        {
#if UNITY_IOS
            GameCenterPlatform.ResetAllAchievements(success => { Debug.Log("Reset achieve,emts" + success); });
#endif
        }
    public void ResetAchievements()
    {
#if UNITY_IPHONE && !UNITY_EDITOR
        GameCenterPlatform.ResetAllAchievements(ResetAchievementsHandler);
#endif
    }
Beispiel #6
0
 public void ResetAchievements()
 {
     GameCenterPlatform.ResetAllAchievements(ResetAchievementsHandler);
 }