public bool DispatchEvent <T>(GameObject _target, string _eventName, ref T _t) { List <SuperFunctionUnit> unitList = DispatchEventReal <SuperFunctionCallBackV0 <T> >(_target, _eventName); if (unitList != null) { for (int i = 0; i < unitList.Count; i++) { SuperFunctionUnit unit = unitList[i]; if (unit.isOnce) { RemoveEventListener(unit.index); } SuperFunctionCallBackV0 <T> cb = unit.callBack as SuperFunctionCallBackV0 <T>; cb(unit.index, ref _t); } unitList.Clear(); ReleaseList(unitList); return(true); } else { return(false); } }
public void RemoveEventListener <T>(GameObject _target, string _eventName, SuperFunctionCallBackV0 <T> _callBack) { RemoveEventListenerReal(_target, _eventName, _callBack); }
public int AddEventListener <T>(GameObject _target, string _eventName, SuperFunctionCallBackV0 <T> _callBack) { return(AddEventListener(_target, _eventName, _callBack, false)); }