Class GenericControl
Represents a generic UI control.
Inherited Members
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
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
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
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
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
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
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
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
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
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 |