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); }
/// <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); } }
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); } }
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); } }