using UnityEngine; public static class ComponentHelper { public static T GetComponentInChildrenWithoutParent(this Component obj) where T : Component { foreach (var comp in obj.GetComponentsInChildren()) if (comp.gameObject != obj.gameObject) return comp; return null; } }