public void UnRegisterHandler(int id, TTUIMsgHandler handler) { if ((handler != null) && this.handlerDic.ContainsKey(id)) { this.handlerDic[id] = Delegate.Remove(this.handlerDic[id], handler); if (this.handlerDic[id] == null) { this.handlerDic.Remove(id); } } }
public void RegisterHandler(int id, TTUIMsgHandler handler) { if (handler == null) { Debug.LogWarning("handler is null"); } else { if (!this.handlerDic.ContainsKey(id)) { this.handlerDic.Add(id, null); } this.handlerDic[id] = Delegate.Combine(this.handlerDic[id], handler); } }
public void RegisterHandler(int id, TTUIMsgHandler handler) { if (handler == null) { Debug.LogWarning("handler is null"); } else { if (!this.handlerDic.ContainsKey(id)) { this.handlerDic.Add(id, null); } this.handlerDic[id] = Delegate.Combine( this.handlerDic[id], handler); } }
public void UnRegisterHandler(int id, TTUIMsgHandler handler) { if ((handler != null) && this.handlerDic.ContainsKey(id)) { this.handlerDic[id] = Delegate.Remove( this.handlerDic[id], handler); if (this.handlerDic[id] == null) { this.handlerDic.Remove(id); } } }