Пример #1
0
        public virtual void HandleEvent(GameObject sender, EventTriggerType triggerType, BaseEventData triggerEventData)
        {
            XUEventData eventData = GetEventData(triggerType);

            if (eventData != null && eventData.onEvent != null)
            {
                eventData.onEvent(triggerType, eventData.strEvent, eventData.objParam, sender, triggerEventData);
            }
        }
Пример #2
0
 public virtual void RemoveEventData(EventTriggerType triggerType)
 {
     if (IsHave(triggerType))
     {
         XUEventData eventData = GetEventData(triggerType);
         if (eventData != null)
         {
             eventData.Reset();
         }
         mEventDataMap.Remove(triggerType);
     }
 }
Пример #3
0
 public virtual void GetEventData(EventTriggerType triggerType, out string strEvent, out object objParam)
 {
     if (IsHave(triggerType))
     {
         XUEventData eventData = GetEventData(triggerType);
         strEvent = eventData.strEvent;
         objParam = eventData.objParam;
     }
     else
     {
         strEvent = string.Empty;
         objParam = null;
     }
 }
Пример #4
0
        public virtual void SetEventData(EventTriggerType triggerType, string strEvent, object objParam, EventDelegate onEvent)
        {
            XUEventData eventData = null;

            if (IsHave(triggerType))
            {
                eventData = GetEventData(triggerType);
            }
            else
            {
                eventData = new XUEventData();
            }
            eventData.Set(strEvent, objParam, onEvent ?? eventData.onEvent);
            if (IsHave(triggerType))
            {
                mEventDataMap[triggerType] = eventData;
            }
            else
            {
                mEventDataMap.Add(triggerType, eventData);
            }
        }