コード例 #1
0
    public void ResetAchievements()
    {
        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:
            GameCenterManager.ResetAchievements();
            break;

        case RuntimePlatform.Android:
            GooglePlayManager.instance.ResetAllAchievements();
            break;
        }
    }
コード例 #2
0
    public void ResetAchievements()
    {
        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:
            GameCenterManager.ResetAchievements();
            break;

        case RuntimePlatform.Android:
            if (UltimateMobileSettings.Instance.PlatformEngine == UM_PlatformDependencies.Amazon)
            {
                //Just do nothing for Amazon
            }
            else
            {
                GooglePlayManager.Instance.ResetAllAchievements();
            }
            break;
        }
    }
コード例 #3
0
    //--------------------------------------
    //  PUBLIC METHODS
    //--------------------------------------

    void OnGUI()
    {
        UpdateToStartPos();

        if (GameCenterManager.Player != null)
        {
            GUI.Label(new Rect(100, 10, Screen.width, 40), "ID: " + GameCenterManager.Player.Id);
            GUI.Label(new Rect(100, 20, Screen.width, 40), "Name: " + GameCenterManager.Player.DisplayName);
            GUI.Label(new Rect(100, 30, Screen.width, 40), "Alias: " + GameCenterManager.Player.Alias);


            //avatar loading will take a while after the user is connectd
            //so we will draw it only after instantiation to avoid null pointer check
            //if you whant to know exaxtly when the avatar is loaded, you can subscribe on
            //GameCenterManager.OnUserInfoLoaded action
            //and checl for a spesific user ID
            if (GameCenterManager.Player.SmallPhoto != null)
            {
                GUI.DrawTexture(new Rect(10, 10, 75, 75), GameCenterManager.Player.SmallPhoto);
            }
        }

        StartY += YLableStep;
        StartY += YLableStep;
        StartY += YLableStep;


        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Game Center Leaderboards", style);


        StartY += YLableStep;

        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Leaderboards"))
        {
            GameCenterManager.ShowLeaderboards();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Load Sets Info"))
        {
            GameCenterManager.OnLeaderboardSetsInfoLoaded += OnLeaderboardSetsInfoLoaded;
            GameCenterManager.LoadLeaderboardSetInfo();
        }

        StartX  = XStartPos;
        StartY += YButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Leaderboard 1"))
        {
            GameCenterManager.ShowLeaderboard(leaderBoardId_1);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Report Score LB 1"))
        {
            hiScore++;
            GameCenterManager.ReportScore(hiScore, leaderBoardId_1);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Get Score LB 1"))
        {
            GameCenterManager.LoadLeaderboardInfo(leaderBoardId_1);
        }


        StartX  = XStartPos;
        StartY += YButtonStep;

        StartY += YLableStep;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Leaderboard #2, user best score: " + LB2BestScores.ToString(), style);


        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Leader Board2"))
        {
            GameCenterManager.ShowLeaderboard(leaderBoardId_2);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Leaderboard 2 Today"))
        {
            GameCenterManager.ShowLeaderboard(leaderBoardId_2, GK_TimeSpan.TODAY);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Report Score LB2"))
        {
            hiScore++;

            GameCenterManager.OnScoreSubmitted += OnScoreSubmitted;
            GameCenterManager.ReportScore(hiScore, leaderBoardId_2);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Get Score LB 2"))
        {
            GameCenterManager.LoadLeaderboardInfo(leaderBoardId_2);
        }


        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Send Challenge"))
        {
            GameCenterManager.IssueLeaderboardChallenge(leaderBoardId_2, "Here's a tiny challenge for you");
        }



        StartX  = XStartPos;
        StartY += YButtonStep;
        StartY += YLableStep;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "Game Center Achievements", style);

        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Show Achievements"))
        {
            GameCenterManager.ShowAchievements();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Reset Achievements"))
        {
            GameCenterManager.ResetAchievements();
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Submit Achievements1"))
        {
            GameCenterManager.SubmitAchievement(GameCenterManager.GetAchievementProgress(TEST_ACHIEVEMENT_1_ID) + 2.432f, TEST_ACHIEVEMENT_1_ID);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Submit Achievements2"))
        {
            GameCenterManager.SubmitAchievement(88.66f, TEST_ACHIEVEMENT_2_ID, false);
        }

        StartX += XButtonStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Send Challenge"))
        {
            GameCenterManager.IssueAchievementChallenge(TEST_ACHIEVEMENT_1_ID, "Here's a tiny challenge for you");
        }



        StartX  = XStartPos;
        StartY += YButtonStep;
        StartY += YLableStep;
        GUI.Label(new Rect(StartX, StartY, Screen.width, 40), "More", style);

        StartY += YLableStep;
        if (GUI.Button(new Rect(StartX, StartY, buttonWidth, buttonHeight), "Retrieve Signature"))
        {
            GameCenterManager.RetrievePlayerSignature();
            GameCenterManager.OnPlayerSignatureRetrieveResult += OnPlayerSignatureRetrieveResult;
        }
    }
コード例 #4
0
 public void ResetAchievements()
 {
     Debug.Log("ResetAchievements");
     GameCenterManager.ResetAchievements();
 }