コード例 #1
0
    public void LoadScoresForLeaderboard(bool aroundMyRankResults, int count = 0)
    {
        MaxVisibleScores = (count > 0) ? count : int.MaxValue;
#if UNITY_IPHONE || UNITY_ANDROID
        PlayGameServices.loadScoresForLeaderboard(_leaderboardID, GPGLeaderboardTimeScope.AllTime, false, aroundMyRankResults);
        Debug.LogWarning("call LoadScoresForLeaderboard");
#endif
    }
コード例 #2
0
    private void secondColumnButtions()
    {
        GUILayout.Label("Leaderboards");

        if (GUILayout.Button("Show Leaderboard"))
        {
            PlayGameServices.showLeaderboard("CgkI_-mLmdQEEAIQBQ", GPGLeaderboardTimeScope.AllTime);
        }


        if (GUILayout.Button("Show All Leaderboards"))
        {
            PlayGameServices.showLeaderboards();
        }


        if (GUILayout.Button("Submit Score"))
        {
            PlayGameServices.submitScore("CgkI_-mLmdQEEAIQBQ", 567);
        }


        if (GUILayout.Button("Load Raw Score Data"))
        {
            PlayGameServices.loadScoresForLeaderboard("CgkI_-mLmdQEEAIQBQ", GPGLeaderboardTimeScope.AllTime, false, false);
        }


        if (GUILayout.Button("Get Leaderboard Metadata"))
        {
            var info = PlayGameServices.getAllLeaderboardMetadata();
            Prime31.Utils.logObject(info);
        }


        if (GUILayout.Button("Get Achievement Metadata"))
        {
            var info = PlayGameServices.getAllAchievementMetadata();
            Prime31.Utils.logObject(info);
        }


        if (GUILayout.Button("Reload All Metadata"))
        {
            PlayGameServices.reloadAchievementAndLeaderboardData();
        }
    }
コード例 #3
0
        public static void DownloadLeaderboardTopScores(Leaderboard leaderboard, TimeScope timeScope = TimeScope.AllTime)
        {
            if (!instanceExists)
            {
                return;
            }

            if (instance.debugMode)
            {
                Debug.LogFormat("LeaderboardManager:DownloadLeaderboardTopScores({0},{1})", leaderboard, timeScope);
            }

#if UNITY_IOS || UNITY_TVOS
            GameCenterBinding.retrieveScores(false, TimeScope2GameCenterLeaderboardTimeScope(timeScope), 1, instance.loadTopScoreCount, instance.leaderboardInfos[(int)leaderboard].leaderboardId);
#elif UNITY_ANDROID && !CHS
            PlayGameServices.loadScoresForLeaderboard(instance.leaderboardInfos[(int)leaderboard].leaderboardId, TimeScope2GPGLeaderboardTimeScope(timeScope), false, false);
#endif
        }