public void RemoveListenerBtn(string protoCode, OnBtnActionHandler handler) { if (dicBtn.ContainsKey(protoCode)) { dicBtn[protoCode].Remove(handler); if (dicBtn[protoCode].Count == 0) { dicBtn.Remove(protoCode); } } }
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; } }