示例#1
0
        public void RemoveListen(string command)
        {
            command = command.Split('_')[1];

            if (ExtensionMap.ContainsKey(command))
            {
                ExtensionMap.Remove(command);
            }
        }
示例#2
0
        private void ListenInner(string command, ExtensionCallback callback)
        {
            if (ExtensionMap.ContainsKey(command))
            {
                Debug.Log("Already listening command: " + command);
                return;
            }

            ExtensionMap.Add(command, callback);
        }
示例#3
0
        public void SetResponse(string command, object data)
        {
            ResponseMap[command] = JsonConvert.SerializeObject(data);

            if (ExtensionMap.ContainsKey(command))
            {
                ExtensionMap[command]();
            }

            if (PromiseMap.ContainsKey(command))
            {
                Promise.Promise promise = PromiseMap[command];
                PromiseMap.Remove(command);
                promise.Resolve();
            }
            Signals.ResponseHelper.Dispatch(command);
            //dispatcher.Dispatch(commandType, command);
        }