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); } }
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 AddEvent(Transform Obj, LiteAction <EventSystemData> Callback, EventSystemType Type = EventSystemType.Click) { if (Obj == null) { return; } EventSystemListener.AddCallback(Obj, Type, Callback); }
public static void RemoveEvent(Transform Obj, EventSystemType Type = EventSystemType.Click) { if (Obj == null) { return; } 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 ClearEventFromChild(Transform Parent, string ChildPath, EventSystemType Type) { var Obj = Parent?.Find(ChildPath); if (Obj != null) { EventSystemListener.ClearCallback(Obj, Type); } }
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 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); } }
public static void ClearEvent(Transform Obj, EventSystemType Type) { EventSystemListener.ClearCallback(Obj, Type); }