예제 #1
0
    private void OnUpdateAchievementCompleted(AGSUpdateAchievementResponse response)
    {
        Action <bool> callback = simpleCallbacks.ContainsKey(response.userData) ? simpleCallbacks[response.userData] : null;

        if (null != callback)
        {
            callback(!response.IsError());
        }
        simpleCallbacks.Remove(response.userData);
    }
예제 #2
0
    /// <summary>
    ///  callback method for native code to communicate events back to unity
    /// </summary>
    public static void UpdateAchievementSucceeded(string json)
    {
        AGSUpdateAchievementResponse response = AGSUpdateAchievementResponse.FromJSON(json);

        if (!response.IsError() && UpdateAchievementSucceededEvent != null)
        {
            UpdateAchievementSucceededEvent(response.achievementId);
        }
        if (UpdateAchievementCompleted != null)
        {
            UpdateAchievementCompleted(response);
        }
    }
예제 #3
0
    private void OnUpdateAchievementCompleted(AGSUpdateAchievementResponse response)
    {
        if (response.IsError())
        {
            AMN_UpdateAchievementResult result = new AMN_UpdateAchievementResult(response.achievementId, response.error);

            OnUpdateAchievementReceived(result);
        }
        else
        {
            AMN_UpdateAchievementResult result = new AMN_UpdateAchievementResult(response.achievementId);

            OnUpdateAchievementReceived(result);
        }
    }
예제 #4
0
 private void OnUpdateAchievementCompleted( AGSUpdateAchievementResponse response )
 {
     Action<bool> callback = simpleCallbacks.ContainsKey(response.userData) ? simpleCallbacks[response.userData] : null;
     if (null != callback) {
         callback(!response.IsError());
     }
     simpleCallbacks.Remove (response.userData);
 }
 private void OnUpdateAchievementCompleted( AGSUpdateAchievementResponse response )
 {
     if (response.IsError()) {
         // Update the achievement submission status to show the error.
         achievementsSubmissionStatus[response.achievementId] = string.Format(achievementFailedLabel, response.achievementId);
         achievementsSubmissionStatusMessage[response.achievementId] = response.error;
     } else {
         // Update the status message to show that achievement submission was successful.
         achievementsSubmissionStatus[response.achievementId] = string.Format(achievementSucceededLabel, response.achievementId);
     }
 }