Example #1
0
        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);
            }
        }
Example #2
0
 public void RemoveEventListener <T>(GameObject _target, string _eventName, SuperFunctionCallBackV0 <T> _callBack)
 {
     RemoveEventListenerReal(_target, _eventName, _callBack);
 }
Example #3
0
 public int AddEventListener <T>(GameObject _target, string _eventName, SuperFunctionCallBackV0 <T> _callBack)
 {
     return(AddEventListener(_target, _eventName, _callBack, false));
 }