public void AddNotify(int notify, GameObject target, UnityAction <T> action) { NotifySet <T> set = GetNotifySet(notify); if (set == null) { set = new NotifySet <T>(); set.notify = notify; registerSets.Add(set); } else { set.RemoveData(target); } NotifyData <T> info = new NotifyData <T> { target = target, notify = notify, uEvent = new NotifyEvent <T>() }; info.uEvent.AddListener(action); set.AddData(info); }
public void AddData(NotifyData <T> data) { set.Add(data); }