internal static IntPtr CreateEventSystem(string name, EventSystemType type) { var ptr = NativeUIMethods.CreateEventSystem(name, type); Delegates.Add(ptr, new Dictionary<uint, MethodInfo>()); return ptr; }
public static void ClearEventFromChild(Transform Parent, string ChildPath, EventSystemType Type) { var Obj = Parent?.Find(ChildPath); if (Obj != null) { EventSystemListener.ClearCallback(Obj, Type); } }
public static void RemoveEvent(Transform Obj, UnityAction Callback, EventSystemType Type = EventSystemType.Click) { if (Obj == null) { return; } EventSystemListener.RemoveCallback(Obj, Type, Callback); }
public static void RemoveEvent(Transform Obj, EventSystemType Type = EventSystemType.Click) { if (Obj == null) { return; } EventSystemListener.ClearCallback(Obj, Type); }
private static EventSystemBaseHandler GetOrCreateHandler(GameObject Master, EventSystemType Type) { var Handler = Master.GetComponent(EventHandlerList_[Type]); if (Handler == null) { Handler = Master.AddComponent(EventHandlerList_[Type]); } return(Handler as EventSystemBaseHandler); }
public static void ClearCallback(Transform Master, EventSystemType Type) { var Handler = Master.GetComponent(EventHandlerList_[Type]) as EventSystemBaseHandler; if (Handler != null) { Handler.Dispose(); UnityEngine.Object.DestroyImmediate(Handler); } }
public static void AddEvent(Transform Obj, UnityAction Callback, EventSystemType Type = EventSystemType.Click) { if (LiteConfigure.EnableButtonClick && Type == EventSystemType.Click) { var Btn = Obj?.GetComponent <Button>(); if (Btn != null) { Btn.onClick.AddListener(Callback); return; } } EventHelper.AddEvent(Obj, Callback, Type); }
public static void RemoveEvent(GameEntity Entity, UnityAction Callback, EventSystemType Type = EventSystemType.Click) { RemoveEvent(Entity?.GetTransform(), Callback, Type); }
public static void RemoveEventFromChild(GameEntity Entity, string ChildPath, Action <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { EventHelper.RemoveEventFromChild(Entity, ChildPath, Callback, Type); }
public static void AddEvent(GameEntity Entity, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { AddEvent(Entity?.GetTransform(), Callback, Type); }
public static void ClearEventFromChild(GameEntity Entity, string ChildPath, EventSystemType Type) { ClearEventFromChild(Entity?.GetTransform(), ChildPath, Type); }
public static void RemoveEventFromChild(Transform Parent, string ChildPath, UnityAction Callback, EventSystemType Type = EventSystemType.Click) { if (LiteConfigure.EnableButtonClick && Type == EventSystemType.Click) { var Btn = Parent?.Find(ChildPath)?.GetComponent <Button>(); if (Btn != null) { Btn.onClick.RemoveListener(Callback); return; } } EventHelper.RemoveEventFromChild(Parent, ChildPath, Callback, Type); }
public static void RemoveEventFromChild(Transform Parent, string ChildPath, Action <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { EventHelper.RemoveEventFromChild(Parent, ChildPath, Callback, Type); }
public void AddEventToChild(string ChildPath, UnityAction Callback, EventSystemType Type = EventSystemType.Click) { UIHelper.AddEventToChild(UITransform, ChildPath, Callback, Type); }
public void RemoveEvent(LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { UIHelper.RemoveEvent(UITransform, Callback, Type); }
public static void AddEvent(Transform Obj, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { if (Obj == null) { return; } EventSystemListener.AddCallback(Obj, Type, Callback); }
public static void ClearEvent(Transform Obj, EventSystemType Type) { EventSystemListener.ClearCallback(Obj, Type); }
public static void AddEvent(Transform Obj, Action <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { EventHelper.AddEvent(Obj, Callback, Type); }
public static void RemoveCallback(Transform Master, EventSystemType Type, UnityAction Callback) { GetOrCreateHandler(Master.gameObject, Type).RemoveCallback(Callback); }
public static void AddCallback(Transform Master, EventSystemType Type, LiteAction <EventSystemData> Callback) { GetOrCreateHandler(Master.gameObject, Type).AddCallback(Callback); }
public static void AddEvent(GameEntity Entity, Action <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { EventHelper.AddEvent(Entity, Callback, Type); }
public static void RemoveEvent(GameEntity Entity, EventSystemType Type = EventSystemType.Click) { RemoveEvent(Entity?.GetTransform(), Type); }
public LiteUIEventAttribute(string Path, EventSystemType EventType = EventSystemType.Click) : base(Path) { this.EventType = EventType; }
public static void ClearEvent(GameEntity Entity, EventSystemType Type) { ClearEvent(Entity?.GetTransform(), Type); }
public static void AddEventToChild(GameEntity Entity, string ChildPath, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { AddEventToChild(Entity?.GetTransform(), ChildPath, Callback, Type); }
public static void AddEventToChild(Transform Parent, string ChildPath, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { var Obj = Parent?.Find(ChildPath); if (Obj != null) { EventSystemListener.AddCallback(Obj, Type, Callback); } }
public static void RemoveEventFromChild(Transform Parent, string ChildPath, UnityAction Callback, EventSystemType Type = EventSystemType.Click) { var Obj = Parent?.Find(ChildPath); if (Obj != null) { EventSystemListener.RemoveCallback(Obj, Type, Callback); } }
public void RemoveEvent(UnityAction Callback, EventSystemType Type = EventSystemType.Click) { UIHelper.RemoveEvent(UITransform, Callback, Type); }
public static void RemoveEventFromChild(GameEntity Entity, string ChildPath, UnityAction Callback, EventSystemType Type = EventSystemType.Click) { RemoveEventFromChild(Entity?.GetTransform(), ChildPath, Callback, Type); }
public void RemoveEventFromChild(string ChildPath, UnityAction Callback, EventSystemType Type = EventSystemType.Click) { UIHelper.RemoveEventFromChild(UITransform, ChildPath, Callback, Type); }
public static void AddEventToChild(GameEntity Entity, string ChildPath, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { EventHelper.AddEventToChild(Entity, ChildPath, Callback, Type); }