public void RemoveEvent(eEvents type, GameEventHandler handler) { List <GameEventHandler> handlerList = m_event_dic.ContainsKey(type) ? m_event_dic[type] : null; if (handlerList != null && handlerList.Contains(handler)) { handlerList.Remove(handler); } }
public void AddEvent(eEvents type, GameEventHandler handler) { List <GameEventHandler> handlerList = m_event_dic.ContainsKey(type) ? m_event_dic[type] : null; if (handlerList == null) { m_event_dic[type] = new List <GameEventHandler>(); } if (m_event_dic[type].Contains(handler)) { return; } m_event_dic[type].Add(handler); }