docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IGUIState

    Interface for GUIStates

    Namespace: UnityEditor.U2D.Path.GUIFramework
    Assembly: Unity.2D.Path.Editor.dll
    Syntax
    public interface IGUIState

    Properties

    changed

    Indicates whether the GUI has changed.

    Declaration
    bool changed { get; set; }
    Property Value
    Type Description
    bool

    clickCount

    The number of mouse clicks.

    Declaration
    int clickCount { get; set; }
    Property Value
    Type Description
    int

    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
    int

    isActionKeyDown

    Indicates whether the action key is pressed.

    Declaration
    bool isActionKeyDown { get; }
    Property Value
    Type Description
    bool

    isAltDown

    Indicates whether the alt key is pressed.

    Declaration
    bool isAltDown { get; }
    Property Value
    Type Description
    bool

    isShiftDown

    Indicates whether the shift key is pressed.

    Declaration
    bool isShiftDown { get; }
    Property Value
    Type Description
    bool

    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
    int

    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
    int

    Methods

    AddControl(int, float)

    Adds a control to the GUIState.

    Declaration
    void AddControl(int controlID, float distance)
    Parameters
    Type Name Description
    int controlID

    The ID of the control to add.

    float distance

    The distance from the camera to the control.

    DistanceToCircle(Vector3, float)

    Measures the distance to a circle.

    Declaration
    float DistanceToCircle(Vector3 center, float radius)
    Parameters
    Type Name Description
    Vector3 center

    The center of the circle

    float radius

    The radius of the circle

    Returns
    Type Description
    float

    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
    float

    Returns the GUI-space distance between p1 and p2.

    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 guiPosition.

    GetControlID(int, FocusType)

    Declaration
    int GetControlID(int hint, FocusType focusType)
    Parameters
    Type Name Description
    int hint
    FocusType focusType
    Returns
    Type Description
    int

    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
    float

    Returns the size of the handle.

    HasCurrentCamera()

    Checks if the current camera is valid.

    Declaration
    bool HasCurrentCamera()
    Returns
    Type Description
    bool

    Returns true if the current camera is not null. Otherwise, returns false.

    Repaint()

    Repaints the GUI.

    Declaration
    void Repaint()

    Slider(int, SliderData, out Vector3)

    Checks whether a slider value has changed.

    Declaration
    bool Slider(int id, SliderData sliderData, out Vector3 newPosition)
    Parameters
    Type Name Description
    int 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
    bool

    Returns true if the slider has changed. Otherwise, returns false.

    UseEvent()

    Uses the event.

    Declaration
    void UseEvent()
    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)