docs.unity.cn
    Show / Hide Table of Contents

    Method GetLayer

    GetLayer()

    Gets the layer of the GameObject.

    Declaration
    public int GetLayer()
    Returns
    Type Description
    Int32

    Returns the layer of the GameObject.

    Remarks

    This takes a dependency on the layer.

    GetLayer(Component)

    Gets the layer of the GameObject for a given component.

    Declaration
    public int GetLayer(Component component)
    Parameters
    Type Name Description
    Component component

    The Object to get the tag from

    Returns
    Type Description
    Int32

    Returns the layer of the GameObject.

    Remarks

    This takes a dependency on the layer.

    GetLayer(GameObject)

    Gets the layer of the GameObject for a given GameObject.

    Declaration
    public int GetLayer(GameObject gameObject)
    Parameters
    Type Name Description
    GameObject gameObject

    The GameObject to get the layer from

    Returns
    Type Description
    Int32

    Returns the layer of the GameObject.

    Remarks

    This takes a dependency on the layer.

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