docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetComponentInChildren

    GetComponentInChildren(GameObject)

    Gets a single component of type T using the non-allocating GetComponentsInChildren API.

    Declaration
    public static T GetComponentInChildren(GameObject gameObject)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject from which to get the component.

    Returns
    Type Description
    T

    The component, if one exists.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)