public void RemoveHandle(Type type, TocHandler handler) { if (mHandlerDict.ContainsKey(type)) { mHandlerDict[type] -= handler; } }
public void AddHandler(Type type, TocHandler handler) { if (_handlerDic.ContainsKey(type)) { _handlerDic[type] += handler; } else { _handlerDic.Add(type, handler); } }
/// <summary> /// 增加消息回调 /// </summary> /// <param name="type"></param> /// <param name="handler"></param> public void AddHandler(Type type, TocHandler handler) { if (mHandlerDict.ContainsKey(type)) { mHandlerDict[type] += handler; } else { mHandlerDict.Add(type, handler); } }
protected void AddTocHandler(Type type, TocHandler handler) { NetManager.Instance.AddHandler(type, handler); }