private void Send(string eventMessage, UIEventInfo eventInfo) { GetLastUIEventInfo = eventInfo; for (var eventListenerIndex = 0; eventListenerIndex < EventListenerGroup.Count; ++eventListenerIndex) { var eventListener = EventListenerGroup[eventListenerIndex]; var isListenableForBroadcast = eventListener.ListenableForBroadcast; var isCollidedEventListener = eventInfo.Collider != null && eventListener.gameObject == eventInfo.Collider.gameObject; var hasEqualEventId = eventListener.EventInfo.IsActive && eventListener.EventInfo.Id == eventInfo.Id; if (isListenableForBroadcast || isCollidedEventListener || hasEqualEventId) { eventListener.SendMessage(eventMessage); } } }
public void SetLastUIEventInfo(UIEventInfo eventInfo) { GetLastUIEventInfo = eventInfo; }