public static void OrderChildren(this Transform tx, Func <Transform, object> selector) { foreach (Transform transforms in tx.Cast <Transform>().OrderBy <Transform, object>(selector)) { transforms.SetAsLastSibling(); } }
/// <summary> /// Найти первый активный дочерний элемент /// </summary> private Transform GetFirstActiveChild(Transform transform) { return transform.Cast<Transform>().FirstOrDefault(child => child.gameObject.activeInHierarchy); }
public static List <Transform> GetChildren(this Transform transform) { return(transform.Cast <Transform>().ToList <Transform>()); }
private List<NodeInfo> GetChildren(Transform transform, string parentClassName) { return transform.Cast<Transform>() .Select<Transform, NodeInfo>(t => GetNodeInfo(t, parentClassName)) .Distinct() .ToList(); }