Exemple #1
0
        public void FindLeaderboard(OnLeaderboardRetrieved onLeaderboardRetrieved, string leaderboardName)
        {
            Leaderboard leaderboard1 = (Leaderboard)null;

            foreach (Leaderboard leaderboard2 in this._leaderboardList)
            {
                if (leaderboard2.LeaderboardName == leaderboardName)
                {
                    leaderboard1 = leaderboard2;
                    break;
                }
            }
            if (leaderboard1 != null)
            {
                onLeaderboardRetrieved(leaderboard1);
            }
            else
            {
                this._onLeaderboardRetrieved = onLeaderboardRetrieved;
                if (this._internalOnLeaderboardRetrieved == null)
                {
                    this._internalOnLeaderboardRetrieved = new OnLeaderboardRetrievedFromSteam(this.OnLeaderboardRetrievedCallback);
                }
                if (Leaderboards.SteamUnityAPI_SteamUserStats_FindLeaderboard(this._stats, leaderboardName, Marshal.GetFunctionPointerForDelegate((Delegate)this._internalOnLeaderboardRetrieved)))
                {
                    return;
                }
                this._onLeaderboardRetrieved((Leaderboard)null);
            }
        }
Exemple #2
0
 internal Leaderboard(Leaderboards leaderboards, ulong leaderboard, string leaderboardName, int entryCount, ELeaderboardSortMethod sortMethod, ELeaderboardDisplayType displayType)
 {
     this._stats           = Leaderboard.SteamUnityAPI_SteamUserStats();
     this._leaderboards    = leaderboards;
     this._leaderboard     = leaderboard;
     this._leaderboardName = leaderboardName;
     this._entryCount      = entryCount;
     this._sortMethod      = sortMethod;
     this._displayType     = displayType;
 }
Exemple #3
0
 internal Leaderboards()
 {
     this._stats = Leaderboards.SteamUnityAPI_SteamUserStats();
 }
Exemple #4
0
        private void OnLeaderboardRetrievedCallback(ref LeaderboardFindResult_t findLearderboardResult)
        {
            Leaderboard leaderboard = (Leaderboard)null;

            if ((int)findLearderboardResult.m_bLeaderboardFound != 0)
            {
                leaderboard = new Leaderboard(this, findLearderboardResult.m_hSteamLeaderboard, Leaderboards.SteamUnityAPI_SteamUserStats_GetLeaderboardName(this._stats, findLearderboardResult.m_hSteamLeaderboard), Leaderboards.SteamUnityAPI_SteamUserStats_GetLeaderboardEntryCount(this._stats, findLearderboardResult.m_hSteamLeaderboard), Leaderboards.SteamUnityAPI_SteamUserStats_GetLeaderboardSortMethod(this._stats, findLearderboardResult.m_hSteamLeaderboard), Leaderboards.SteamUnityAPI_SteamUserStats_GetLeaderboardDisplayType(this._stats, findLearderboardResult.m_hSteamLeaderboard));
                this.Add(leaderboard);
            }
            this._onLeaderboardRetrieved(leaderboard);
        }