Class InputControlPathEditor
Custom editor UI for editing control paths.
Implements
Namespace: UnityEngine .InputSystem .Editor
Assembly: Unity.InputSystem.dll
Syntax
public sealed class InputControlPathEditor : IDisposable
Remarks
This is the implementation underlying Input
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 |
---|---|---|
Serialized |
pathProperty | string type property that will receive the picked input control path. |
Input |
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 |
Exceptions
Type | Condition |
---|---|
Argument |
|
Properties
onModified
Declaration
public Action onModified { get; }
Property Value
Type | Description |
---|---|
Action |
pathProperty
Declaration
public SerializedProperty pathProperty { get; }
Property Value
Type | Description |
---|---|
Serialized |
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 | |
Serialized |
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
Register |
Remarks
// Pick only button controls.
editor.SetExpectedControlLayout("Button");
SetExpectedControlLayoutFromAttribute()
Declaration
public void SetExpectedControlLayoutFromAttribute()