Esempio n. 1
0
        /// <summary>
        /// Handles an <c>onGetLeaderboardsFinished</c> event
        /// </summary>
        /// <param name="message">
        /// Will contain a numeric representation of <c>Provider</c>,
        /// and payload</param>
        public void onGetLeaderboardsFinished(String message)
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onGetLeaderboardsFinished");

            JSONObject eventJson = new JSONObject(message);

            Provider provider = Provider.fromInt((int)eventJson["provider"].n);


            JSONObject payloadJSON = new JSONObject(eventJson ["payload"].str);

            JSONObject         leaderboardsArray = eventJson ["leaderboards"];
            List <Leaderboard> leaderboards      = new List <Leaderboard>();

            foreach (JSONObject leaderboardJson in leaderboardsArray.list)
            {
                leaderboards.Add(new Leaderboard(leaderboardJson));
            }

            SocialPageData <Leaderboard> data = new SocialPageData <Leaderboard>();

            data.PageData   = leaderboards;
            data.PageNumber = 0;
            data.HasMore    = false;

            ProfileEvents.OnGetLeaderboardsFinished(new GetLeaderboardsFinishedEvent(provider, data, ProfilePayload.GetUserPayload(payloadJSON)));
        }