Example #1
0
        public void Invoke(int callbackID, EActionResultCode resultCode, string msg)
        {
            GPlaySDK.LogFormat("ActionCallbackManager.Invoke", "callbackID: {0}  result:{1}  msg:{2}", callbackID, resultCode, msg);
            if (actionCallbacks.ContainsKey(callbackID))
            {
                if (actionCallbacks[callbackID] != null)
                {
                    actionCallbacks[callbackID].Invoke(resultCode, msg);
                }
                else
                {
                    GPlaySDK.LogErrorFormat("ActionCallbackManager.Invoke", "callbackID callback({0}) is null", callbackID);
                }

                actionCallbacks.Remove(callbackID);
            }
            else
            {
                GPlaySDK.LogErrorFormat("ActionCallbackManager.Invoke", "callbackID({0}) not exists", callbackID);
            }
        }
Example #2
0
 public int AddCallback(ActionCallback callback)
 {
     GPlaySDK.LogErrorFormat("ActionCallbackManager.AddCallback", "callbackID: {0}", callbackID);
     actionCallbacks[callbackID] = callback;
     return(callbackID++);
 }