Beispiel #1
0
        internal static IntPtr CreateEventSystem(string name, EventSystemType type)
        {
            var ptr = NativeUIMethods.CreateEventSystem(name, type);

            Delegates.Add(ptr, new Dictionary<uint, MethodInfo>());
            return ptr;
        }
Beispiel #2
0
        public static void ClearEventFromChild(Transform Parent, string ChildPath, EventSystemType Type)
        {
            var Obj = Parent?.Find(ChildPath);

            if (Obj != null)
            {
                EventSystemListener.ClearCallback(Obj, Type);
            }
        }
Beispiel #3
0
        public static void RemoveEvent(Transform Obj, UnityAction Callback, EventSystemType Type = EventSystemType.Click)
        {
            if (Obj == null)
            {
                return;
            }

            EventSystemListener.RemoveCallback(Obj, Type, Callback);
        }
Beispiel #4
0
        public static void RemoveEvent(Transform Obj, EventSystemType Type = EventSystemType.Click)
        {
            if (Obj == null)
            {
                return;
            }

            EventSystemListener.ClearCallback(Obj, Type);
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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);
            }
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
 public static void RemoveEvent(GameEntity Entity, UnityAction Callback, EventSystemType Type = EventSystemType.Click)
 {
     RemoveEvent(Entity?.GetTransform(), Callback, Type);
 }
Beispiel #9
0
 public static void RemoveEventFromChild(GameEntity Entity, string ChildPath, Action <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
 {
     EventHelper.RemoveEventFromChild(Entity, ChildPath, Callback, Type);
 }
Beispiel #10
0
 public static void AddEvent(GameEntity Entity, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
 {
     AddEvent(Entity?.GetTransform(), Callback, Type);
 }
Beispiel #11
0
 public static void ClearEventFromChild(GameEntity Entity, string ChildPath, EventSystemType Type)
 {
     ClearEventFromChild(Entity?.GetTransform(), ChildPath, Type);
 }
Beispiel #12
0
        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);
        }
Beispiel #13
0
 public static void RemoveEventFromChild(Transform Parent, string ChildPath, Action <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
 {
     EventHelper.RemoveEventFromChild(Parent, ChildPath, Callback, Type);
 }
Beispiel #14
0
 public void AddEventToChild(string ChildPath, UnityAction Callback, EventSystemType Type = EventSystemType.Click)
 {
     UIHelper.AddEventToChild(UITransform, ChildPath, Callback, Type);
 }
Beispiel #15
0
 public void RemoveEvent(LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
 {
     UIHelper.RemoveEvent(UITransform, Callback, Type);
 }
Beispiel #16
0
        public static void AddEvent(Transform Obj, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
        {
            if (Obj == null)
            {
                return;
            }

            EventSystemListener.AddCallback(Obj, Type, Callback);
        }
Beispiel #17
0
 public static void ClearEvent(Transform Obj, EventSystemType Type)
 {
     EventSystemListener.ClearCallback(Obj, Type);
 }
Beispiel #18
0
 public static void AddEvent(Transform Obj, Action <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
 {
     EventHelper.AddEvent(Obj, Callback, Type);
 }
Beispiel #19
0
 public static void RemoveCallback(Transform Master, EventSystemType Type, UnityAction Callback)
 {
     GetOrCreateHandler(Master.gameObject, Type).RemoveCallback(Callback);
 }
Beispiel #20
0
 public static void AddCallback(Transform Master, EventSystemType Type, LiteAction <EventSystemData> Callback)
 {
     GetOrCreateHandler(Master.gameObject, Type).AddCallback(Callback);
 }
Beispiel #21
0
 public static void AddEvent(GameEntity Entity, Action <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
 {
     EventHelper.AddEvent(Entity, Callback, Type);
 }
Beispiel #22
0
 public static void RemoveEvent(GameEntity Entity, EventSystemType Type = EventSystemType.Click)
 {
     RemoveEvent(Entity?.GetTransform(), Type);
 }
Beispiel #23
0
 public LiteUIEventAttribute(string Path, EventSystemType EventType = EventSystemType.Click)
     : base(Path)
 {
     this.EventType = EventType;
 }
Beispiel #24
0
 public static void ClearEvent(GameEntity Entity, EventSystemType Type)
 {
     ClearEvent(Entity?.GetTransform(), Type);
 }
Beispiel #25
0
 public static void AddEventToChild(GameEntity Entity, string ChildPath, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
 {
     AddEventToChild(Entity?.GetTransform(), ChildPath, Callback, Type);
 }
Beispiel #26
0
        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);
            }
        }
Beispiel #27
0
        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);
            }
        }
Beispiel #28
0
 public void RemoveEvent(UnityAction Callback, EventSystemType Type = EventSystemType.Click)
 {
     UIHelper.RemoveEvent(UITransform, Callback, Type);
 }
Beispiel #29
0
 public static void RemoveEventFromChild(GameEntity Entity, string ChildPath, UnityAction Callback, EventSystemType Type = EventSystemType.Click)
 {
     RemoveEventFromChild(Entity?.GetTransform(), ChildPath, Callback, Type);
 }
Beispiel #30
0
 public void RemoveEventFromChild(string ChildPath, UnityAction Callback, EventSystemType Type = EventSystemType.Click)
 {
     UIHelper.RemoveEventFromChild(UITransform, ChildPath, Callback, Type);
 }
Beispiel #31
0
 public static void AddEventToChild(GameEntity Entity, string ChildPath, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
 {
     EventHelper.AddEventToChild(Entity, ChildPath, Callback, Type);
 }