Пример #1
0
        /// <summary>
        /// With this command you can Unlock achievement with the achievement ID
        /// you registered in the Developer panel.
        /// </summary>
        /// <param name="achievementId">The ID of Achievement you Want To Unlock it</param>
        /// <param name="callback"> Unlock Achievement Object<see cref="DelegateCore.OnUnlockAchievement"/></param>
        /// <param name="error">Error</param>
        public void UnlockAchievement(
            string achievementId,
            DelegateCore.OnUnlockAchievement callback,
            DelegateCore.OnError error)
        {
            if (_gameServiceObj == null)
            {
                if (_isAvailable)
                {
                    if (FiroozehGameService.Configuration.EnableLog)
                    {
                        LogUtil.LogError(Tag, "GameService Is NotAvailable yet");
                    }
                }
                else
                {
                    if (FiroozehGameService.Configuration.EnableLog)
                    {
                        LogUtil.LogError(Tag, "You Logout Before ,You Must Config it Again...");
                    }
                }
                return;
            }

            _gameServiceObj.Call("UnlockAchievement"
                                 , achievementId
                                 , _haveNotification
                                 , new IGameServiceCallback(onCallback => {
                callback.Invoke(JsonConvert.DeserializeObject <Achievement>(onCallback));
            }
                                                            , error.Invoke));
        }
Пример #2
0
 public void UnlockAchievement(
     string achievementId,
     DelegateCore.OnUnlockAchievement callback,
     DelegateCore.OnError error)
 {
     if (_gameServiceObj != null)
     {
         _gameServiceObj.Call("UnlockAchievement"
                              , achievementId
                              , _haveNotification
                              , new IGameServiceCallback(Oncallback => {
             callback.Invoke(JsonConvert.DeserializeObject <Achievement>(Oncallback));
         }
                                                         , error.Invoke));
     }
 }