/// <summary>
        /// Loads the achievement state for the current user.
        /// </summary>
        /// <param name="callback">The callback to receive the achievements</param>
        public void LoadAchievements(Action <IAchievement[]> callback)
        {
            if (!IsAuthenticated())
            {
                GooglePlayGames.OurUtils.Logger.e("LoadAchievements can only be called after authentication.");
                callback.Invoke(null);
            }

            mClient.LoadAchievements(ach => {
                IAchievement[] data = new IAchievement[ach.Length];
                for (int i = 0; i < data.Length; i++)
                {
                    data [i] = new PlayGamesAchievement(ach [i]);
                }

                callback.Invoke(data);
            });
        }
 public void LoadAchievements(Action <IAchievement[]> callback)
 {
     if (!IsAuthenticated())
     {
         Logger.e("LoadAchievements can only be called after authentication.");
         callback(null);
     }
     else
     {
         mClient.LoadAchievements(delegate(Achievement[] ach)
         {
             IAchievement[] array = (IAchievement[])new IAchievement[ach.Length];
             for (int i = 0; i < array.Length; i++)
             {
                 array[i] = new PlayGamesAchievement(ach[i]);
             }
             callback(array);
         });
     }
 }
        public void ReportProgressUsesCorrectState()
        {
            string capturedId = "initial" ;
            double capturedProgress = 0.0;
            Action<bool> capturedCallback = null;

            PlayGamesAchievement achievement = new PlayGamesAchievement(
                (id, progress, callback) => {
                    capturedId = id;
                    capturedProgress = progress;
                    capturedCallback = callback;
                });

            Action<bool> dummy = ignored => { };
            achievement.id = "expectedId";
            achievement.percentCompleted = 50.0;

            achievement.ReportProgress(dummy);

            Assert.AreSame(capturedCallback, dummy);
            Assert.AreEqual("expectedId", capturedId);
            Assert.AreEqual(50.0, capturedProgress);
        }
        /// <summary>
        /// Loads the achievement state for the current user.
        /// <param name="callback">The callback to receive the achievements</param>
        /// </summary>
        public void LoadAchievements(Action<IAchievement[]> callback)
        {
            if (!IsAuthenticated())
            {
                GooglePlayGames.OurUtils.Logger.e("LoadAchievements can only be called after authentication.");
                callback.Invoke(null);
            }

            mClient.LoadAchievements(ach =>
                {
                    IAchievement[] data = new IAchievement[ach.Length];
                    for (int i = 0; i < data.Length; i++)
                    {
                        data[i] = new PlayGamesAchievement(ach[i]);
                    }

                    callback.Invoke(data);
                });
        }