Пример #1
0
        public sealed override Action <BridgeRequest, BridgeResponse> PullListener(CallUnityMethod key)
        {
            Action <BridgeRequest, BridgeResponse> method;

            if (!staticUnityMethods.TryGetValue(key, out method))
            {
                return(null);
            }
            return(method);
        }
Пример #2
0
        protected void AsyncInvokePlatform(CallPlatformMethod invokeMethod, CallUnityMethod callbackMethod, Action <BridgeResponse> method, params JsonData[] args)
        {
            var request     = BridgeRequest.Create(invokeMethod.ToString(), callbackMethod.ToString(), args);
            var requestJson = request.ToJson();

            try
            {
                DebugUtility.Log(LoggerTags.Module, "异步调用 -> arg:{0};", requestJson);
                PushListener(request.callbackMethod, method);
                InvokePlatform(requestJson);
            }
            catch (Exception ex)
            {
                DebugUtility.LogError(LoggerTags.Module, "异步调用 -> arg:{0}; 异常 -> Exception:{1}", requestJson, ex);
            }
        }
Пример #3
0
 protected sealed override void PushListener(CallUnityMethod key, Action <BridgeRequest, BridgeResponse> method)
 {
     staticUnityMethods[key] = method;
 }
Пример #4
0
 public abstract Action <BridgeRequest, BridgeResponse> PullListener(CallUnityMethod key);
Пример #5
0
 protected abstract void PushListener(CallUnityMethod key, Action <BridgeRequest, BridgeResponse> method);