using System; using System.Collections.Generic; using UnityEngine.UI; namespace UnityEngine.EventSystems { // Token: 0x0200001A RID: 26 public static class ExecuteEvents { // Token: 0x06000047 RID: 71 RVA: 0x00002AA8 File Offset: 0x00000EA8 public static T ValidateEventData(BaseEventData data) where T : class { if (!(data is T)) { throw new ArgumentException(string.Format("Invalid type: {0} passed to event expecting {1}", data.GetType(), typeof(T))); } return data as T; } // Token: 0x06000048 RID: 72 RVA: 0x00002B07 File Offset: 0x00000F07 private static void Execute(IPointerEnterHandler handler, BaseEventData eventData) { handler.OnPointerEnter(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x06000049 RID: 73 RVA: 0x00002B16 File Offset: 0x00000F16 private static void Execute(IPointerExitHandler handler, BaseEventData eventData) { handler.OnPointerExit(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x0600004A RID: 74 RVA: 0x00002B25 File Offset: 0x00000F25 private static void Execute(IPointerDownHandler handler, BaseEventData eventData) { handler.OnPointerDown(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x0600004B RID: 75 RVA: 0x00002B34 File Offset: 0x00000F34 private static void Execute(IPointerUpHandler handler, BaseEventData eventData) { handler.OnPointerUp(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x0600004C RID: 76 RVA: 0x00002B43 File Offset: 0x00000F43 private static void Execute(IPointerClickHandler handler, BaseEventData eventData) { handler.OnPointerClick(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x0600004D RID: 77 RVA: 0x00002B52 File Offset: 0x00000F52 private static void Execute(IInitializePotentialDragHandler handler, BaseEventData eventData) { handler.OnInitializePotentialDrag(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x0600004E RID: 78 RVA: 0x00002B61 File Offset: 0x00000F61 private static void Execute(IBeginDragHandler handler, BaseEventData eventData) { handler.OnBeginDrag(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x0600004F RID: 79 RVA: 0x00002B70 File Offset: 0x00000F70 private static void Execute(IDragHandler handler, BaseEventData eventData) { handler.OnDrag(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x06000050 RID: 80 RVA: 0x00002B7F File Offset: 0x00000F7F private static void Execute(IEndDragHandler handler, BaseEventData eventData) { handler.OnEndDrag(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x06000051 RID: 81 RVA: 0x00002B8E File Offset: 0x00000F8E private static void Execute(IDropHandler handler, BaseEventData eventData) { handler.OnDrop(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x06000052 RID: 82 RVA: 0x00002B9D File Offset: 0x00000F9D private static void Execute(IScrollHandler handler, BaseEventData eventData) { handler.OnScroll(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x06000053 RID: 83 RVA: 0x00002BAC File Offset: 0x00000FAC private static void Execute(IUpdateSelectedHandler handler, BaseEventData eventData) { handler.OnUpdateSelected(eventData); } // Token: 0x06000054 RID: 84 RVA: 0x00002BB6 File Offset: 0x00000FB6 private static void Execute(ISelectHandler handler, BaseEventData eventData) { handler.OnSelect(eventData); } // Token: 0x06000055 RID: 85 RVA: 0x00002BC0 File Offset: 0x00000FC0 private static void Execute(IDeselectHandler handler, BaseEventData eventData) { handler.OnDeselect(eventData); } // Token: 0x06000056 RID: 86 RVA: 0x00002BCA File Offset: 0x00000FCA private static void Execute(IMoveHandler handler, BaseEventData eventData) { handler.OnMove(ExecuteEvents.ValidateEventData(eventData)); } // Token: 0x06000057 RID: 87 RVA: 0x00002BD9 File Offset: 0x00000FD9 private static void Execute(ISubmitHandler handler, BaseEventData eventData) { handler.OnSubmit(eventData); } // Token: 0x06000058 RID: 88 RVA: 0x00002BE3 File Offset: 0x00000FE3 private static void Execute(ICancelHandler handler, BaseEventData eventData) { handler.OnCancel(eventData); } // Token: 0x1700000C RID: 12 // (get) Token: 0x06000059 RID: 89 RVA: 0x00002BF0 File Offset: 0x00000FF0 public static ExecuteEvents.EventFunction pointerEnterHandler { get { return ExecuteEvents.s_PointerEnterHandler; } } // Token: 0x1700000D RID: 13 // (get) Token: 0x0600005A RID: 90 RVA: 0x00002C0C File Offset: 0x0000100C public static ExecuteEvents.EventFunction pointerExitHandler { get { return ExecuteEvents.s_PointerExitHandler; } } // Token: 0x1700000E RID: 14 // (get) Token: 0x0600005B RID: 91 RVA: 0x00002C28 File Offset: 0x00001028 public static ExecuteEvents.EventFunction pointerDownHandler { get { return ExecuteEvents.s_PointerDownHandler; } } // Token: 0x1700000F RID: 15 // (get) Token: 0x0600005C RID: 92 RVA: 0x00002C44 File Offset: 0x00001044 public static ExecuteEvents.EventFunction pointerUpHandler { get { return ExecuteEvents.s_PointerUpHandler; } } // Token: 0x17000010 RID: 16 // (get) Token: 0x0600005D RID: 93 RVA: 0x00002C60 File Offset: 0x00001060 public static ExecuteEvents.EventFunction pointerClickHandler { get { return ExecuteEvents.s_PointerClickHandler; } } // Token: 0x17000011 RID: 17 // (get) Token: 0x0600005E RID: 94 RVA: 0x00002C7C File Offset: 0x0000107C public static ExecuteEvents.EventFunction initializePotentialDrag { get { return ExecuteEvents.s_InitializePotentialDragHandler; } } // Token: 0x17000012 RID: 18 // (get) Token: 0x0600005F RID: 95 RVA: 0x00002C98 File Offset: 0x00001098 public static ExecuteEvents.EventFunction beginDragHandler { get { return ExecuteEvents.s_BeginDragHandler; } } // Token: 0x17000013 RID: 19 // (get) Token: 0x06000060 RID: 96 RVA: 0x00002CB4 File Offset: 0x000010B4 public static ExecuteEvents.EventFunction dragHandler { get { return ExecuteEvents.s_DragHandler; } } // Token: 0x17000014 RID: 20 // (get) Token: 0x06000061 RID: 97 RVA: 0x00002CD0 File Offset: 0x000010D0 public static ExecuteEvents.EventFunction endDragHandler { get { return ExecuteEvents.s_EndDragHandler; } } // Token: 0x17000015 RID: 21 // (get) Token: 0x06000062 RID: 98 RVA: 0x00002CEC File Offset: 0x000010EC public static ExecuteEvents.EventFunction dropHandler { get { return ExecuteEvents.s_DropHandler; } } // Token: 0x17000016 RID: 22 // (get) Token: 0x06000063 RID: 99 RVA: 0x00002D08 File Offset: 0x00001108 public static ExecuteEvents.EventFunction scrollHandler { get { return ExecuteEvents.s_ScrollHandler; } } // Token: 0x17000017 RID: 23 // (get) Token: 0x06000064 RID: 100 RVA: 0x00002D24 File Offset: 0x00001124 public static ExecuteEvents.EventFunction updateSelectedHandler { get { return ExecuteEvents.s_UpdateSelectedHandler; } } // Token: 0x17000018 RID: 24 // (get) Token: 0x06000065 RID: 101 RVA: 0x00002D40 File Offset: 0x00001140 public static ExecuteEvents.EventFunction selectHandler { get { return ExecuteEvents.s_SelectHandler; } } // Token: 0x17000019 RID: 25 // (get) Token: 0x06000066 RID: 102 RVA: 0x00002D5C File Offset: 0x0000115C public static ExecuteEvents.EventFunction deselectHandler { get { return ExecuteEvents.s_DeselectHandler; } } // Token: 0x1700001A RID: 26 // (get) Token: 0x06000067 RID: 103 RVA: 0x00002D78 File Offset: 0x00001178 public static ExecuteEvents.EventFunction moveHandler { get { return ExecuteEvents.s_MoveHandler; } } // Token: 0x1700001B RID: 27 // (get) Token: 0x06000068 RID: 104 RVA: 0x00002D94 File Offset: 0x00001194 public static ExecuteEvents.EventFunction submitHandler { get { return ExecuteEvents.s_SubmitHandler; } } // Token: 0x1700001C RID: 28 // (get) Token: 0x06000069 RID: 105 RVA: 0x00002DB0 File Offset: 0x000011B0 public static ExecuteEvents.EventFunction cancelHandler { get { return ExecuteEvents.s_CancelHandler; } } // Token: 0x0600006A RID: 106 RVA: 0x00002DCC File Offset: 0x000011CC private static void GetEventChain(GameObject root, IList eventChain) { eventChain.Clear(); if (!(root == null)) { Transform transform = root.transform; while (transform != null) { eventChain.Add(transform); transform = transform.parent; } } } // Token: 0x0600006B RID: 107 RVA: 0x00002E1C File Offset: 0x0000121C public static bool Execute(GameObject target, BaseEventData eventData, ExecuteEvents.EventFunction functor) where T : IEventSystemHandler { List list = ExecuteEvents.s_HandlerListPool.Get(); ExecuteEvents.GetEventList(target, list); int i = 0; while (i < list.Count) { T t; try { t = (T)((object)list[i]); } catch (Exception ex) { IEventSystemHandler eventSystemHandler = list[i]; Debug.LogException(new Exception(string.Format("Type {0} expected {1} received.", typeof(T).Name, eventSystemHandler.GetType().Name), ex)); goto IL_8F; } goto Block_2; IL_8F: i++; continue; Block_2: try { functor(t, eventData); } catch (Exception ex2) { Debug.LogException(ex2); } goto IL_8F; } int count = list.Count; ExecuteEvents.s_HandlerListPool.Release(list); return count > 0; } // Token: 0x0600006C RID: 108 RVA: 0x00002F08 File Offset: 0x00001308 public static GameObject ExecuteHierarchy(GameObject root, BaseEventData eventData, ExecuteEvents.EventFunction callbackFunction) where T : IEventSystemHandler { ExecuteEvents.GetEventChain(root, ExecuteEvents.s_InternalTransformList); for (int i = 0; i < ExecuteEvents.s_InternalTransformList.Count; i++) { Transform transform = ExecuteEvents.s_InternalTransformList[i]; if (ExecuteEvents.Execute(transform.gameObject, eventData, callbackFunction)) { return transform.gameObject; } } return null; } // Token: 0x0600006D RID: 109 RVA: 0x00002F70 File Offset: 0x00001370 private static bool ShouldSendToComponent(Component component) where T : IEventSystemHandler { bool flag; if (!(component is T)) { flag = false; } else { Behaviour behaviour = component as Behaviour; flag = !(behaviour != null) || behaviour.isActiveAndEnabled; } return flag; } // Token: 0x0600006E RID: 110 RVA: 0x00002FBC File Offset: 0x000013BC private static void GetEventList(GameObject go, IList results) where T : IEventSystemHandler { if (results == null) { throw new ArgumentException("Results array is null", "results"); } if (!(go == null) && go.activeInHierarchy) { List list = ListPool.Get(); go.GetComponents(list); for (int i = 0; i < list.Count; i++) { if (ExecuteEvents.ShouldSendToComponent(list[i])) { results.Add(list[i] as IEventSystemHandler); } } ListPool.Release(list); } } // Token: 0x0600006F RID: 111 RVA: 0x00003050 File Offset: 0x00001450 public static bool CanHandleEvent(GameObject go) where T : IEventSystemHandler { List list = ExecuteEvents.s_HandlerListPool.Get(); ExecuteEvents.GetEventList(go, list); int count = list.Count; ExecuteEvents.s_HandlerListPool.Release(list); return count != 0; } // Token: 0x06000070 RID: 112 RVA: 0x00003090 File Offset: 0x00001490 public static GameObject GetEventHandler(GameObject root) where T : IEventSystemHandler { GameObject gameObject; if (root == null) { gameObject = null; } else { Transform transform = root.transform; while (transform != null) { if (ExecuteEvents.CanHandleEvent(transform.gameObject)) { return transform.gameObject; } transform = transform.parent; } gameObject = null; } return gameObject; } // Token: 0x04000026 RID: 38 private static readonly ExecuteEvents.EventFunction s_PointerEnterHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000027 RID: 39 private static readonly ExecuteEvents.EventFunction s_PointerExitHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000028 RID: 40 private static readonly ExecuteEvents.EventFunction s_PointerDownHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000029 RID: 41 private static readonly ExecuteEvents.EventFunction s_PointerUpHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x0400002A RID: 42 private static readonly ExecuteEvents.EventFunction s_PointerClickHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x0400002B RID: 43 private static readonly ExecuteEvents.EventFunction s_InitializePotentialDragHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x0400002C RID: 44 private static readonly ExecuteEvents.EventFunction s_BeginDragHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x0400002D RID: 45 private static readonly ExecuteEvents.EventFunction s_DragHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x0400002E RID: 46 private static readonly ExecuteEvents.EventFunction s_EndDragHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x0400002F RID: 47 private static readonly ExecuteEvents.EventFunction s_DropHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000030 RID: 48 private static readonly ExecuteEvents.EventFunction s_ScrollHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000031 RID: 49 private static readonly ExecuteEvents.EventFunction s_UpdateSelectedHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000032 RID: 50 private static readonly ExecuteEvents.EventFunction s_SelectHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000033 RID: 51 private static readonly ExecuteEvents.EventFunction s_DeselectHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000034 RID: 52 private static readonly ExecuteEvents.EventFunction s_MoveHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000035 RID: 53 private static readonly ExecuteEvents.EventFunction s_SubmitHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000036 RID: 54 private static readonly ExecuteEvents.EventFunction s_CancelHandler = new ExecuteEvents.EventFunction(ExecuteEvents.Execute); // Token: 0x04000037 RID: 55 private static readonly ObjectPool> s_HandlerListPool = new ObjectPool>(null, delegate(List l) { l.Clear(); }); // Token: 0x04000038 RID: 56 private static readonly List s_InternalTransformList = new List(30); // Token: 0x0200001B RID: 27 // (Invoke) Token: 0x06000074 RID: 116 public delegate void EventFunction(T1 handler, BaseEventData eventData); } }