예제 #1
0
 protected void Execute(string eventID, CallbackEventData eventData)
 {
     if (this.delegates != null)
     {
         int num   = 0;
         int count = this.delegates.Count;
         while (num < count)
         {
             CallbackHandler.Entry item = this.delegates[num];
             if (item.eventID == eventID && item.callback != null)
             {
                 item.callback.Invoke(eventData);
             }
             num++;
         }
     }
 }
        //Execute event
        protected void ExecuteEvent <T>(EventFunction <T> func, bool includeDisabled = false) where T : ITriggerEventHandler
        {
            for (int i = 0; i < this.m_TriggerEvents.Length; i++)
            {
                ITriggerEventHandler handler = this.m_TriggerEvents[i];
                if (ShouldSendEvent <T>(handler, includeDisabled))
                {
                    func.Invoke((T)handler, PlayerInfo.gameObject);
                }
            }
            string eventID = string.Empty;

            if (this.m_CallbackHandlers.TryGetValue(typeof(T), out eventID))
            {
                CallbackEventData triggerEventData = new CallbackEventData();
                triggerEventData.AddData("Trigger", this);
                triggerEventData.AddData("Player", PlayerInfo.gameObject);
                triggerEventData.AddData("EventData", new PointerEventData(EventSystem.current));
                base.Execute(eventID, triggerEventData);
            }
        }
예제 #3
0
 private void OnClose(CallbackEventData ev)
 {
     this.m_Status = ActionStatus.Failure;
     this.m_DialogBox.RemoveListener("OnClose", OnClose);
 }