static public void Dispatch <T1, T2>(string evt, T1 param1, T2 param2) { HashSet <Delegate> hashSet; if (!callbackFuncs.TryGetValue(evt, out hashSet)) { return; } HashSet <Delegate> .Enumerator em = hashSet.GetEnumerator(); do { CALLBACK_FUNC_2 <T1, T2> handler = (em.Current as CALLBACK_FUNC_2 <T1, T2>); if (handler == null) { continue; } handler.Invoke(param1, param2); } while (em.MoveNext()); }
static public void RemoveListener <T1, T2>(string evt, CALLBACK_FUNC_2 <T1, T2> func) { TryRemoveDelegate(evt, func); }
static public void AddListener <T1, T2>(string evt, CALLBACK_FUNC_2 <T1, T2> func) { TryAddDelegate(evt, func); }