docs.unity.cn
    Show / Hide Table of Contents

    Struct LayoutData

    Represents the layout of a GUI element in a custom editor.

    Namespace: UnityEditor.U2D.Path.GUIFramework
    Syntax
    public struct LayoutData

    Fields

    distance

    The distance from the layout to the camera.

    Declaration
    public float distance
    Field Value
    Type Description
    Single

    forward

    The layout's world-space forward vector.

    Declaration
    public Vector3 forward
    Field Value
    Type Description
    Vector3

    index

    The layout's index.

    Declaration
    public int index
    Field Value
    Type Description
    Int32

    position

    The layout's world-space position.

    Declaration
    public Vector3 position
    Field Value
    Type Description
    Vector3

    right

    The layout's world-space right vector.

    Declaration
    public Vector3 right
    Field Value
    Type Description
    Vector3

    up

    The layout's world-space up vector.

    Declaration
    public Vector3 up
    Field Value
    Type Description
    Vector3

    userData

    The layout's user data.

    Declaration
    public object userData
    Field Value
    Type Description
    Object

    zero

    Zero definition of LayoutData.

    Declaration
    public static readonly LayoutData zero
    Field Value
    Type Description
    LayoutData

    Methods

    Nearest(LayoutData, LayoutData)

    Gets the layout that is closest to the camera,

    Declaration
    public static LayoutData Nearest(LayoutData currentData, LayoutData newData)
    Parameters
    Type Name Description
    LayoutData currentData

    The current layout.

    LayoutData newData

    The new layout to compare with.

    Returns
    Type Description
    LayoutData

    Returns the closest layout to the camera. If currentData is closest to the camera, returns currentData. Otherwise, if newData is closest to the camera, returns newData.

    Back to top Copyright © 2022 Unity Technologies
    Generated by DocFX
    on Tuesday, March 1, 2022
    Terms of use