예제 #1
0
 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);
 }
예제 #2
0
 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);
 }