docs.unity.cn
    Show / Hide Table of Contents

    Method GetParent

    GetParent()

    Returns the parent of the GameObject

    Declaration
    public GameObject GetParent()
    Returns
    Type Description
    GameObject

    The parent if one is found or null otherwise

    Remarks

    This will take a dependency on the parent

    GetParent(Component)

    Returns the parent of the GameObject

    Declaration
    public GameObject GetParent(Component component)
    Parameters
    Type Name Description
    Component component

    The Object to get the parent from

    Returns
    Type Description
    GameObject

    The parent if one is found or null otherwise

    Remarks

    This will take a dependency on the parent

    GetParent(GameObject)

    Returns the parent of the GameObject

    Declaration
    public GameObject GetParent(GameObject gameObject)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject to get the parent from

    Returns
    Type Description
    GameObject

    The parent if one is found or null otherwise

    Remarks

    This will take a dependency on the parent

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023