Beispiel #1
0
    /// <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));
    }
Beispiel #2
0
    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);
    }