Interface IGUIState
Interface for GUIStates
Namespace: UnityEditor.U2D.Path.GUIFramework
Syntax
public interface IGUIState
Properties
changed
Indicates whether the GUI has changed.
Declaration
bool changed { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
clickCount
The number of mouse clicks.
Declaration
int clickCount { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
commandName
The name of the event's command.
Declaration
string commandName { get; }
Property Value
| Type | Description |
|---|---|
| String |
eventType
The type of the event.
Declaration
EventType eventType { get; }
Property Value
| Type | Description |
|---|---|
| EventType |
hotControl
Hot Control
Declaration
int hotControl { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
isActionKeyDown
Indicates whether the action key is pressed.
Declaration
bool isActionKeyDown { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
isAltDown
Indicates whether the alt key is pressed.
Declaration
bool isAltDown { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
isShiftDown
Indicates whether the shift key is pressed.
Declaration
bool isShiftDown { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
keyCode
The KeyCode of the currently pressed key.
Declaration
KeyCode keyCode { get; }
Property Value
| Type | Description |
|---|---|
| KeyCode |
mouseButton
The mouse button pressed.
Declaration
int mouseButton { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
mousePosition
The mouse position.
Declaration
Vector2 mousePosition { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
nearestControl
The closest control to the event.
Declaration
int nearestControl { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Methods
AddControl(Int32, Single)
Adds a control to the GUIState.
Declaration
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. |
DistanceToCircle(Vector3, Single)
Measures the distance to a circle.
Declaration
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. |
DistanceToSegment(Vector3, Vector3)
Measures the GUI-space distance between two points of a segment.
Declaration
float DistanceToSegment(Vector3 p1, Vector3 p2)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | p1 | The first point. |
| Vector3 | p2 | The second point. |
Returns
| Type | Description |
|---|---|
| Single | Returns the GUI-space distance between p1 and p2. |
GetControlID(Int32, FocusType)
Declaration
int GetControlID(int hint, FocusType focusType)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | hint | |
| FocusType | focusType |
Returns
| Type | Description |
|---|---|
| Int32 |
GetHandleSize(Vector3)
Gets the size of the handle.
Declaration
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. |
GUIToWorld(Vector2, Vector3, Vector3)
Transforms a GUI-space position into world space.
Declaration
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 |
HasCurrentCamera()
Checks if the current camera is valid.
Declaration
bool HasCurrentCamera()
Returns
| Type | Description |
|---|---|
| Boolean | Returns |
Repaint()
Repaints the GUI.
Declaration
void Repaint()
Slider(Int32, SliderData, out Vector3)
Checks whether a slider value has changed.
Declaration
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 |
UseEvent()
Uses the event.
Declaration
void UseEvent()