Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
        public static void ClearEventFromChild(Transform Parent, string ChildPath, EventSystemType Type)
        {
            var Obj = Parent?.Find(ChildPath);

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

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

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

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