/// <summary> /// Возвращает всех потомков /// </summary> /// /// <returns>Массив потомков</returns> /// /// <exception cref="NullReferenceException">Параметр <param name="root"/>>указывает на null</exception> /// <exception cref="MissingReferenceException">Параметр <param name="root"/>>указывает на уничтоженный объект</exception> public static Transform[] GetChilds(this Transform transform) { if (transform is null) { throw new NullReferenceException(nameof(transform)); } if (!transform) { throw new MissingReferenceException(nameof(transform)); } return(TransformUtilities.GetChildsWithoutChecks(transform)); }
/// <summary> /// Возвращает всех потомков для игрового объекта /// </summary> /// /// <returns>Массив потомков</returns> /// /// <exception cref="NullReferenceException">Параметр <param name="gameObject"/>>указывает на null</exception> /// <exception cref="MissingReferenceException">Параметр <param name="gameObject"/>>указывает на уничтоженный объект</exception> public static Transform[] GetChilds(this GameObject gameObject) { if (gameObject is null) { throw new NullReferenceException(nameof(gameObject)); } if (!gameObject) { throw new MissingReferenceException(nameof(gameObject)); } return(TransformUtilities.GetChildsWithoutChecks(gameObject.transform)); }
public static void GetChilds(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.GetChildsWithoutChecks(transform, result); }