Exemple #1
0
 public void RemoveListenerBtn(string protoCode, OnBtnActionHandler handler)
 {
     if (dicBtn.ContainsKey(protoCode))
     {
         dicBtn[protoCode].Remove(handler);
         if (dicBtn[protoCode].Count == 0)
         {
             dicBtn.Remove(protoCode);
         }
     }
 }
Exemple #2
0
 public void RegisterListenerBtn(string protoCode, OnBtnActionHandler handler)
 {
     if (dicBtn.ContainsKey(protoCode))
     {
         dicBtn[protoCode].Add(handler);
     }
     else
     {
         List <OnBtnActionHandler> handlers = new List <OnBtnActionHandler>();
         handlers.Add(handler);
         dicBtn[protoCode] = handlers;
     }
 }