docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GenericControl

    Represents a generic UI control.

    Inheritance
    object
    Control
    GenericControl
    Inherited Members
    Control.name
    Control.ID
    Control.actionID
    Control.layoutData
    Control.hotLayoutData
    Control.GetControl(IGUIState)
    Control.BeginLayout(IGUIState)
    Control.Layout(IGUIState)
    Control.EndLayout(IGUIState)
    Control.Repaint(IGUIState)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.U2D.Path.GUIFramework
    Assembly: Unity.2D.Path.Editor.dll
    Syntax
    public class GenericControl : Control

    Constructors

    GenericControl(string)

    Initializes and returns an instance of GenericControl

    Declaration
    public GenericControl(string name)
    Parameters
    Type Name Description
    string name

    The name of the generic control.

    Fields

    count

    Func for GetCount

    Declaration
    public Func<int> count
    Field Value
    Type Description
    Func<int>

    distance

    Func for GetDistance

    Declaration
    public Func<IGUIState, int, float> distance
    Field Value
    Type Description
    Func<IGUIState, int, float>

    forward

    Func for GetForward

    Declaration
    public Func<int, Vector3> forward
    Field Value
    Type Description
    Func<int, Vector3>

    onBeginLayout

    Func for OnBeginLayout

    Declaration
    public Func<IGUIState, LayoutData> onBeginLayout
    Field Value
    Type Description
    Func<IGUIState, LayoutData>

    onEndLayout

    Action for OnEndLayout

    Declaration
    public Action<IGUIState> onEndLayout
    Field Value
    Type Description
    Action<IGUIState>

    onRepaint

    Action for OnRepaint

    Declaration
    public Action<IGUIState, Control, int> onRepaint
    Field Value
    Type Description
    Action<IGUIState, Control, int>

    position

    Func for GetPosition

    Declaration
    public Func<int, Vector3> position
    Field Value
    Type Description
    Func<int, Vector3>

    right

    Func for GetRight

    Declaration
    public Func<int, Vector3> right
    Field Value
    Type Description
    Func<int, Vector3>

    up

    Func for GetUp

    Declaration
    public Func<int, Vector3> up
    Field Value
    Type Description
    Func<int, Vector3>

    userData

    Func for GetUserData

    Declaration
    public Func<int, object> userData
    Field Value
    Type Description
    Func<int, object>

    Methods

    GetCount()

    Gets the number of sub-controllers.

    Declaration
    protected override int GetCount()
    Returns
    Type Description
    int

    Returns the number of sub-controllers. If you do not assign getCount, this returns 1.

    Overrides
    Control.GetCount()
    Remarks

    By default, this is 1. If you implement your own controller and want to use multiple sub-controllers within it, you can assign getCount to a function that returns the number of sub-controllers.

    GetDistance(IGUIState, int)

    Gets the distance from the Scene view camera to the control.

    Declaration
    protected override float GetDistance(IGUIState guiState, int index)
    Parameters
    Type Name Description
    IGUIState guiState

    The current state of the custom editor.

    int index

    The Index

    Returns
    Type Description
    float

    Returns the distance from the Scene view camera to the control.

    Overrides
    Control.GetDistance(IGUIState, int)

    GetForward(IGUIState, int)

    Gets the forward vector of the control.

    Declaration
    protected override Vector3 GetForward(IGUIState guiState, int index)
    Parameters
    Type Name Description
    IGUIState guiState

    The current state of the custom editor.

    int index

    The Index

    Returns
    Type Description
    Vector3

    Returns the generic control's forward vector.

    Overrides
    Control.GetForward(IGUIState, int)

    GetPosition(IGUIState, int)

    Gets the position of the control.

    Declaration
    protected override Vector3 GetPosition(IGUIState guiState, int index)
    Parameters
    Type Name Description
    IGUIState guiState

    The current state of the custom editor.

    int index

    The Index

    Returns
    Type Description
    Vector3

    The position

    Overrides
    Control.GetPosition(IGUIState, int)

    GetRight(IGUIState, int)

    Gets the right vector of the control.

    Declaration
    protected override Vector3 GetRight(IGUIState guiState, int index)
    Parameters
    Type Name Description
    IGUIState guiState

    The current state of the custom editor.

    int index

    The Index

    Returns
    Type Description
    Vector3

    Returns the generic control's right vector.

    Overrides
    Control.GetRight(IGUIState, int)

    GetUp(IGUIState, int)

    Gets the up vector of the control.

    Declaration
    protected override Vector3 GetUp(IGUIState guiState, int index)
    Parameters
    Type Name Description
    IGUIState guiState

    The current state of the custom editor.

    int index

    The Index

    Returns
    Type Description
    Vector3

    Returns the generic control's up vector.

    Overrides
    Control.GetUp(IGUIState, int)

    GetUserData(IGUIState, int)

    Override for GetUserData

    Declaration
    protected override object GetUserData(IGUIState guiState, int index)
    Parameters
    Type Name Description
    IGUIState guiState

    The current state of the custom editor.

    int index

    The Index

    Returns
    Type Description
    object

    Return the user data

    Overrides
    Control.GetUserData(IGUIState, int)

    OnBeginLayout(LayoutData, IGUIState)

    Called when the control begins its layout.

    Declaration
    protected override LayoutData OnBeginLayout(LayoutData data, IGUIState guiState)
    Parameters
    Type Name Description
    LayoutData data

    The layout data.

    IGUIState guiState

    The current state of the custom editor.

    Returns
    Type Description
    LayoutData

    The LayoutData

    Overrides
    Control.OnBeginLayout(LayoutData, IGUIState)

    OnEndLayout(IGUIState)

    Called when the control ends its layout.

    Declaration
    protected override void OnEndLayout(IGUIState guiState)
    Parameters
    Type Name Description
    IGUIState guiState

    The current state of the custom editor.

    Overrides
    Control.OnEndLayout(IGUIState)

    OnRepaint(IGUIState, int)

    Called when the control repaints its contents.

    Declaration
    protected override void OnRepaint(IGUIState guiState, int index)
    Parameters
    Type Name Description
    IGUIState guiState

    The current state of the custom editor.

    int index

    Current Index

    Overrides
    Control.OnRepaint(IGUIState, int)
    In This Article
    Back to top
    Copyright © 2025 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)