Class GUIState
An implementation of an IGUIState that represents a generic GUI state.
Namespace: UnityEditor.U2D.Path.GUIFramework
Syntax
public class GUIState : object, IGUIState
Properties
changed
Indicates whether the GUI has changed.
Declaration
public bool changed { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Implements
clickCount
The current number of mouse clicks.
Declaration
public int clickCount { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Implements
commandName
The name of the current event's command.
Declaration
public string commandName { get; }
Property Value
| Type | Description |
|---|---|
| String |
Implements
eventType
The type of the current event.
Declaration
public EventType eventType { get; }
Property Value
| Type | Description |
|---|---|
| EventType |
Implements
hotControl
Hot Control
Declaration
public int hotControl { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Implements
isActionKeyDown
Indicates whether the action key is pressed.
Declaration
public bool isActionKeyDown { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Implements
isAltDown
Indicates whether the alt key is pressed.
Declaration
public bool isAltDown { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Implements
isShiftDown
Indicates whether the shift key is pressed.
Declaration
public bool isShiftDown { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Implements
keyCode
The KeyCode of the currently pressed key.
Declaration
public KeyCode keyCode { get; }
Property Value
| Type | Description |
|---|---|
| KeyCode |
Implements
mouseButton
The currently pressed button.
Declaration
public int mouseButton { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Implements
mousePosition
The current mouse position.
Declaration
public Vector2 mousePosition { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
Implements
nearestControl
The closest control to the event.
Declaration
public int nearestControl { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Implements
Methods
AddControl(Int32, Single)
Adds a control to the GUIState.
Declaration
public void AddControl(int controlID, float distance)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | controlID | The ID of the control to add. |
| Single | distance | The distance from the camera to the control. |
Implements
DistanceToCircle(Vector3, Single)
Measures the distance to a circle.
Declaration
public float DistanceToCircle(Vector3 center, float radius)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | center | The center of the circle. |
| Single | radius | The radius of the circle. |
Returns
| Type | Description |
|---|---|
| Single | Returns the distance to a circle with the specified center and radius. |
Implements
DistanceToSegment(Vector3, Vector3)
Measures the GUI-space distance between two points of a segment.
Declaration
public float DistanceToSegment(Vector3 p1, Vector3 p2)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | p1 | The first point. |
| Vector3 | p2 | The seconde point. |
Returns
| Type | Description |
|---|---|
| Single | Returns the GUI-space distance between p1 and p2. |
Implements
GetControlID(Int32, FocusType)
Gets the ID of a nested control by a hint and focus type.
Declaration
public int GetControlID(int hint, FocusType focusType)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | hint | The hint this function uses to identify the control ID. |
| FocusType | focusType | The focus Type |
Returns
| Type | Description |
|---|---|
| Int32 | Returns the ID of the control that matches the hint and focus type. |
Implements
GetHandleSize(Vector3)
Gets the size of the handle.
Declaration
public float GetHandleSize(Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position | The position of the handle. |
Returns
| Type | Description |
|---|---|
| Single | Returns the size of the handle. |
Implements
GUIToWorld(Vector2, Vector3, Vector3)
Transforms a GUI-space position into world space.
Declaration
public Vector3 GUIToWorld(Vector2 guiPosition, Vector3 planeNormal, Vector3 planePos)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | guiPosition | The GUI position |
| Vector3 | planeNormal | The plane normal. |
| Vector3 | planePos | The plane position. |
Returns
| Type | Description |
|---|---|
| Vector3 | Returns the world-space position of |
Implements
HasCurrentCamera()
Checks if the current camera is valid.
Declaration
public bool HasCurrentCamera()
Returns
| Type | Description |
|---|---|
| Boolean | Returns |
Implements
Repaint()
Repaints the GUI.
Declaration
public void Repaint()
Implements
Slider(Int32, SliderData, out Vector3)
Checks whether a slider value has changed.
Declaration
public bool Slider(int id, SliderData sliderData, out Vector3 newPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | id | The ID of the slider to check. |
| SliderData | sliderData | The slider's data. |
| Vector3 | newPosition | The new position of the slider. |
Returns
| Type | Description |
|---|---|
| Boolean | Returns |
Implements
UseEvent()
Uses the current event.
Declaration
public void UseEvent()