Beispiel #1
0
 /// <summary>
 /// Loads the achievements.
 /// </summary>
 /// <param name='callback'>
 /// Callback.
 /// </param>
 public void LoadAchievements(System.Action <IAchievement[]> callback)
 {
     // The callback argument should not be null for this function.
     if (null == callback)
     {
         AGSClient.LogGameCircleError("LoadAchievements \"callback\" argument should not be null");
         return;
     }
     loadAchievementsCallbacks.Add(requestID, callback);
     AGSAchievementsClient.RequestAchievements(requestID++);
 }
Beispiel #2
0
 /// <summary>
 /// Requests the list of Achievements from the GameCircle plugin.
 /// </summary>
 void RequestAchievements()
 {
     // start the clock, to track the progress of this async operation
     achievementsRequestTime = System.DateTime.Now;
     // subscribe to the events to receive the achievement list.
     SubscribeToAchievementRequestEvents();
     // request the achievement list from the GameCircle plugin.
     AGSAchievementsClient.RequestAchievements();
     // set the request status message to show that achievement retrieval has begun.
     requestAchievementsStatus = requestingAchievementsLabel;
 }
Beispiel #3
0
    public void RequestAchievements()
    {
        if (AGSPlayerClient.IsSignedIn() == false)
        {
            return;
        }

        // subscribe to the events to receive the achievement list.
        SubscribeToAchievementRequestEvents();
        // request the achievement list from the GameCircle plugin.
        AGSAchievementsClient.RequestAchievements();
    }
Beispiel #4
0
        private static void UpdateAchievementsData()
        {
            AGSAchievementsClient.RequestAchievementsCompleted -= OnRequestAchievementsCompleted;
            AGSAchievementsClient.RequestAchievementsCompleted += OnRequestAchievementsCompleted;

            if (!AGSPlayerClient.IsSignedIn())
            {
#if CO_DEBUG
                Debug.LogWarning("AGSAchievementsClient.RequestAchievements(); can only be called after authentication.");
#endif
                return;
            }

            AGSAchievementsClient.RequestAchievements();
        }
    /// <summary>
    /// Loads the achievement descriptions.
    /// </summary>
    /// <param name='callback'>
    /// Callback.
    /// </param>
    public void LoadAchievementDescriptions(System.Action <IAchievementDescription[]> callback)
    {
        // The callback argument should not be null for this function.
        if (null == callback)
        {
            AGSClient.LogGameCircleError("LoadAchievementDescriptions \"callback\" argument should not be null");
            return;
        }

        // Transform the passed in callback action to the type of callback the GameCircle plugin expects.
        AGSAchievementsClient.RequestAchievementsFailedEvent    += (e) => { callback(null); };
        AGSAchievementsClient.RequestAchievementsSucceededEvent += (achievements) => {
            AGSSocialAchievementDescription [] descriptions = new AGSSocialAchievementDescription[achievements.Count];
            for (int achievementIndex = 0; achievementIndex < achievements.Count; achievementIndex++)
            {
                descriptions[achievementIndex] = new AGSSocialAchievementDescription(achievements[achievementIndex]);
            }
            callback(descriptions);
        };
        AGSAchievementsClient.RequestAchievements();
    }
Beispiel #6
0
 /// <summary>
 /// Load the achievements the logged in user has already achieved or reported progress on.
 /// </summary>
 /// <param name="callback">Callback to handle the achievements.</param>
 public void LoadAchievements(Action <IAchievement[]> callback)
 {
     loadAchievementsCallbacks.Add(AmazonLeaderboardUtils.RequestID, callback);
     AGSAchievementsClient.RequestAchievements(AmazonLeaderboardUtils.RequestID++);
 }
Beispiel #7
0
 public void RequestAchievements()
 {
             #if AMAZON_CIRCLE_ENABLED
     AGSAchievementsClient.RequestAchievements();
             #endif
 }