public void RemoveListen(string command) { command = command.Split('_')[1]; if (ExtensionMap.ContainsKey(command)) { ExtensionMap.Remove(command); } }
private void ListenInner(string command, ExtensionCallback callback) { if (ExtensionMap.ContainsKey(command)) { Debug.Log("Already listening command: " + command); return; } ExtensionMap.Add(command, callback); }
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); }