示例#1
0
        public override void ReportProgress(string _achievementID, int _pointsScored, Action <bool> _onCompletion)
        {
            base.ReportProgress(_achievementID, _pointsScored, _onCompletion);

            if (string.IsNullOrEmpty(_achievementID))
            {
                return;
            }

            // Verify user authentication state before proceeding
            if (!VerifyUser())
            {
                if (_onCompletion != null)
                {
                    _onCompletion(false);
                }

                return;
            }

            // Create new instance
            AndroidAchievement _achievement = new AndroidAchievement(_achievementID);

            // Update percentage completed
            _achievement.PointsScored = _pointsScored;

            // Report progress
            _achievement.ReportProgress(_onCompletion);
        }
示例#2
0
 public override Achievement CreateAchievement(string _achievementID)
 {
     // Verify user authentication state before proceeding
     if (VerifyUser())
     {
         return(AndroidAchievement.Create(_achievementID));
     }
     else
     {
         return(null);
     }
 }
        protected override void LoadAchievementsFinished(IDictionary _dataDict)
        {
            IList  _achievementsJSONList = _dataDict.GetIfAvailable <IList>(kAchievementsList);
            string _error = _dataDict.GetIfAvailable <string>(kNativeMessageError);

            Achievement[] _newAchievements = null;


            if (_achievementsJSONList != null)
            {
                _newAchievements = AndroidAchievement.ConvertAchievementList(_achievementsJSONList);
            }

            LoadAchievementsFinished(_newAchievements, _error);
        }