예제 #1
0
        public static void RemoveAllEvent(Transform Parent, bool Recursively)
        {
            if (Parent == null)
            {
                return;
            }

            if (LiteConfigure.EnableButtonClick)
            {
                var Btn = Parent.GetComponent <Button>();
                if (Btn != null)
                {
                    Btn.onClick.RemoveAllListeners();
                }
            }

            EventSystemListener.ClearCallback(Parent);

            if (!Recursively)
            {
                return;
            }

            var ChildCount = Parent.childCount;

            for (var Index = 0; Index < ChildCount; ++Index)
            {
                var Child = Parent.GetChild(Index);
                RemoveAllEvent(Child, Recursively);
            }
        }
예제 #2
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);
            }
        }
예제 #3
0
        public static void AddEvent(Transform Obj, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click)
        {
            if (Obj == null)
            {
                return;
            }

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

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

            EventSystemListener.RemoveCallback(Obj, Type, Callback);
        }
예제 #6
0
        public static void ClearEventFromChild(Transform Parent, string ChildPath, EventSystemType Type)
        {
            var Obj = Parent?.Find(ChildPath);

            if (Obj != null)
            {
                EventSystemListener.ClearCallback(Obj, Type);
            }
        }
예제 #7
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);
            }
        }
예제 #8
0
        public static void RemoveAllEvent(Transform Parent, bool Recursively)
        {
            if (Parent == null)
            {
                return;
            }

            EventSystemListener.ClearCallback(Parent);

            if (!Recursively)
            {
                return;
            }

            var ChildCount = Parent.childCount;

            for (var Index = 0; Index < ChildCount; ++Index)
            {
                var Child = Parent.GetChild(Index);
                RemoveAllEvent(Child, Recursively);
            }
        }
예제 #9
0
 public static void ClearEvent(Transform Obj, EventSystemType Type)
 {
     EventSystemListener.ClearCallback(Obj, Type);
 }