Esempio n. 1
0
 public static void OrderChildren(this Transform tx, Func <Transform, object> selector)
 {
     foreach (Transform transforms in tx.Cast <Transform>().OrderBy <Transform, object>(selector))
     {
         transforms.SetAsLastSibling();
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Найти первый активный дочерний элемент
 /// </summary>
 private Transform GetFirstActiveChild(Transform transform)
 {
     return transform.Cast<Transform>().FirstOrDefault(child => child.gameObject.activeInHierarchy);
 }
Esempio n. 3
0
 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();
 }