docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class InputControlPathEditor

    Custom editor UI for editing control paths.

    Inheritance
    object
    InputControlPathEditor
    Implements
    IDisposable
    Namespace: UnityEngine.InputSystem.Editor
    Assembly: Unity.InputSystem.dll
    Syntax
    public sealed class InputControlPathEditor : IDisposable
    Remarks

    This is the implementation underlying InputControlPathDrawer. It is useful primarily when greater control is required than is offered by the PropertyDrawer mechanism. In particular, it allows applying additional constraints such as requiring control paths to match ...

    Constructors

    InputControlPathEditor(SerializedProperty, InputControlPickerState, Action, GUIContent)

    Initialize the control path editor.

    Declaration
    public InputControlPathEditor(SerializedProperty pathProperty, InputControlPickerState pickerState, Action onModified, GUIContent label = null)
    Parameters
    Type Name Description
    SerializedProperty pathProperty

    string type property that will receive the picked input control path.

    InputControlPickerState pickerState

    Persistent editing state of the path editor. Used to retain state across domain reloads.

    Action onModified

    Delegate that is called when the path has been modified.

    GUIContent label

    Optional label to display instead of display name of pathProperty.

    Exceptions
    Type Condition
    ArgumentNullException

    pathProperty is null.

    Properties

    onModified

    Declaration
    public Action onModified { get; }
    Property Value
    Type Description
    Action

    pathProperty

    Declaration
    public SerializedProperty pathProperty { get; }
    Property Value
    Type Description
    SerializedProperty

    Methods

    Dispose()

    Declaration
    public void Dispose()

    OnGUI()

    Declaration
    public void OnGUI()

    OnGUI(Rect, GUIContent, SerializedProperty, Action)

    Declaration
    public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty property = null, Action modifiedCallback = null)
    Parameters
    Type Name Description
    Rect rect
    GUIContent label
    SerializedProperty property
    Action modifiedCallback

    SetControlPathsToMatch(IEnumerable<string>)

    Declaration
    public void SetControlPathsToMatch(IEnumerable<string> controlPaths)
    Parameters
    Type Name Description
    IEnumerable<string> controlPaths

    SetExpectedControlLayout(string)

    Constrain the type of control layout that can be picked.

    Declaration
    public void SetExpectedControlLayout(string expectedControlLayout)
    Parameters
    Type Name Description
    string expectedControlLayout

    Name of the layout. This it the name as registered with RegisterLayout(Type, string, InputDeviceMatcher?).

    Remarks
    // Pick only button controls.
    editor.SetExpectedControlLayout("Button");

    SetExpectedControlLayoutFromAttribute()

    Declaration
    public void SetExpectedControlLayoutFromAttribute()

    Implements

    IDisposable
    In This Article
    Back to top
    Copyright © 2024 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)