예제 #1
0
        private static void OnSubmitScoreCompleted(
            AGSRequestResponse response,
            long score,
            Action <CloudRequestResult <bool> > callbackAction,
            string id,
            string internalID)
        {
            if (!response.IsError())
            {
#if CLOUDONCE_DEBUG
                var debugMessage = string.Format(
                    "Successfully submitted a score of {0} to {1} ({2}) leaderboard.",
                    score,
                    internalID,
                    id);
                UnityEngine.Debug.Log(debugMessage);
#endif
                CloudOnceUtils.SafeInvoke(callbackAction, new CloudRequestResult <bool>(true));
            }
            else
            {
                var errorMessage = string.Format(
                    "Native API failed to submit a score of {0} to {1} ({2}) leaderboard.\nReported error: {3}",
                    score,
                    internalID,
                    id,
                    response.error);
                ReportError(errorMessage, callbackAction);
            }
        }
예제 #2
0
        private static void OnReportCompleted(
            AGSRequestResponse response, Action <CloudRequestResult <bool> > callbackAction, string action, string id, string internalID)
        {
            if (!response.IsError())
            {
#if CLOUDONCE_DEBUG
                UnityEngine.Debug.Log(string.Format("Achievement {0} ({1}) was successfully {2}ed.", internalID, id, action));
#endif
                CloudOnceUtils.SafeInvoke(callbackAction, new CloudRequestResult <bool>(true));
            }
            else
            {
                // Customize error message to fit either new or old achievement system.
                var error = string.IsNullOrEmpty(internalID)
                        ? string.Format("Native API failed to {0} achievement {1}. Reported error: {2}", action, id, response.error)
                        : string.Format("Native API failed to {0} achievement {1} ({2}). Reported error: {3}", action, internalID, id, response.error);
                ReportError(error, callbackAction);
            }
        }
예제 #3
0
 private static void OnSubmitScoreCompleted(
     AGSRequestResponse response,
     long score,
     Action <CloudRequestResult <bool> > callbackAction,
     string id,
     string internalID)
 {
     if (!response.IsError())
     {
         ReportSubmitScoreSuccess(score, callbackAction, id, internalID);
     }
     else
     {
         var errorMessage = string.Format(
             "Native API failed to submit a score of {0} to {1} ({2}) leaderboard.\nReported error: {3}",
             score,
             internalID,
             id,
             response.error);
         ReportError(errorMessage, callbackAction);
     }
 }