Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
0
 public virtual void RemoveEventData(EventTriggerType triggerType)
 {
     if (IsHave(triggerType))
     {
         XUEventData eventData = GetEventData(triggerType);
         if (eventData != null)
         {
             eventData.Reset();
         }
         mEventDataMap.Remove(triggerType);
     }
 }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 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);
            }
        }