public void DispatchEvent(YxEventType eventType, object param) { VoidObjectDelegate callFunc = GetEventListener(eventType); if (callFunc == null) { return; } if (!this.client.IsMainThread()) { this.DispatchToMainThread(callFunc, param); } else { callFunc(param); } }
public void RemoveEventListener(YxEventType eventType) { if (this.callFuncEventTypeDict.ContainsKey(eventType)) { this.callFuncEventTypeDict.Remove(eventType); } }
public void AddEventListener(YxEventType eventType, VoidObjectDelegate callFunc) { this.callFuncEventTypeDict[eventType] = callFunc; }
public VoidObjectDelegate GetEventListener(YxEventType eventType) { if (this.callFuncEventTypeDict.ContainsKey(eventType)) { return this.callFuncEventTypeDict[eventType]; } return null; }