protected void RemoveListener(string notificationName, ModelDispatcher.Handler action) { if (m_Dic == null) { return; } if (!m_Dic.ContainsKey(notificationName)) { return; } m_Dic.Remove(notificationName); ModelDispatcher.Instance.RemoveEventListener(notificationName, action); }
protected void AddListener(string notificationName, ModelDispatcher.Handler action) { if (m_Dic == null) { m_Dic = new Dictionary <string, DispatcherBase <ModelDispatcher, TransferData, string> .Handler>(); } if (m_Dic.ContainsKey(notificationName)) { return; } m_Dic.Add(notificationName, action); ModelDispatcher.Instance.AddEventListener(notificationName, action); }