using System; using System.Collections.Generic; using UnityEngine; public static class GetAllSubGameObject { public static List GetAllChildren(this GameObject gm) { List objects = new List(); for (int i = 0; i < gm.transform.childCount; i++) { objects.Add(gm.transform.GetChild(i).gameObject); } return objects; } public static bool InitByIdentifier(this Transform tm, out GameObject identifier) { identifier = tm.Find(nameof(identifier))?.gameObject; if (!identifier) return false; else return true; } }