/// <summary> /// Возвращает всех потомков /// </summary> /// /// <returns>Массив потомков</returns> /// /// <exception cref="NullReferenceException">Параметр <param name="root"/>>указывает на null</exception> /// <exception cref="MissingReferenceException">Параметр <param name="root"/>>указывает на уничтоженный объект</exception> public static Transform[] GetChildren(this Transform transform) { if (transform is null) { throw new NullReferenceException(nameof(transform)); } if (!transform) { throw new MissingReferenceException(nameof(transform)); } return(TransformUtilities.GetChildrenWithoutChecks(transform)); }
public static void GetChildren(this Transform transform, List <Transform> result) { if (transform is null) { throw new NullReferenceException(nameof(transform)); } if (!transform) { throw new MissingReferenceException(nameof(transform)); } if (result is null) { throw new ArgumentNullException(nameof(result)); } TransformUtilities.GetChildrenWithoutChecks(transform, result); }