Example #1
0
        //
        // Get all of the children in this transform, recursively
        //
        public static List <Transform> GetAllChildren(this Transform transform)
        {
            var list = new List <Transform>();

            transform.AddAllChildren(list);
            return(list);
        }
        public static List <Transform> GetAllChildren(this Transform transform)
        {
            List <Transform> list = new List <Transform>();

            if (Object.op_Inequality((Object)transform, (Object)null))
            {
                transform.AddAllChildren(list);
            }
            return(list);
        }
Example #3
0
        public static List <Transform> GetAllChildren(this Transform transform)
        {
            List <Transform> transforms = new List <Transform>();

            if (transform != null)
            {
                transform.AddAllChildren(transforms);
            }
            return(transforms);
        }
 public static void AddAllChildren(this Transform transform, List <Transform> list)
 {
     list.Add(transform);
     for (int index = 0; index < transform.get_childCount(); ++index)
     {
         Transform child = transform.GetChild(index);
         if (!Object.op_Equality((Object)child, (Object)null))
         {
             child.AddAllChildren(list);
         }
     }
 }
Example #5
0
 public static void AddAllChildren(this Transform transform, List <Transform> list)
 {
     list.Add(transform);
     for (int i = 0; i < transform.childCount; i++)
     {
         Transform child = transform.GetChild(i);
         if (child != null)
         {
             child.AddAllChildren(list);
         }
     }
 }