public static void RemoveListener(enECType _ecType, Action <object> _callBack) { uint key = (uint)_ecType; if (!HasPDictDefined(key)) { return; } List <Action <object> > listHandlers = mParamDict[key]; for (int i = 0; i < listHandlers.Count; i++) { if (listHandlers[i] == _callBack) { listHandlers.RemoveAt(i); break; } } }
public static void Dispatch(enECType _ecType, object param = null) { uint key = (uint)_ecType; if (param == null && HasDictDefined(key)) { List <Action> listHandlers = mDict[key]; for (int i = 0; i < listHandlers.Count; i++) { listHandlers[i](); } } else if (HasPDictDefined(key)) { List <Action <object> > listHandlers = mParamDict[key]; for (int i = 0; i < listHandlers.Count; i++) { listHandlers[i](param); } } }
static bool IsDontDestroy(enECType _type) { return(_type < enECType.MSG_MODULE); }