Class InputActionDefinition
The definition of an input action: its id, display name, type and default binding. Create one with Button(string, string, InputBinding, string) or Axis1D(string, string, InputBinding, string).
public sealed class InputActionDefinition
- Inheritance
-
InputActionDefinition
- Inherited Members
Properties
ActionType
Whether the action is a button or an axis.
public InputActionType ActionType { get; }
Property Value
Category
The group the action is listed under, such as Movement. Null when it has none.
public string Category { get; }
Property Value
DefaultBinding
The binding the action has before the player changes it.
public InputBinding DefaultBinding { get; }
Property Value
DisplayName
The name shown for the action, such as on a controls screen.
public string DisplayName { get; }
Property Value
Id
The action's id. Game code refers to the action by this id.
public string Id { get; }
Property Value
Methods
Axis1D(string, string, InputBinding, string)
Creates an axis action. Throws when the binding has button inputs.
public static InputActionDefinition Axis1D(string id, string displayName, InputBinding binding, string category = null)
Parameters
idstringdisplayNamestringbindingInputBindingcategorystring
Returns
Exceptions
- ArgumentException
The binding has keyboard keys or gamepad buttons.
Button(string, string, InputBinding, string)
Creates a button action. Throws when the binding has axis inputs.
public static InputActionDefinition Button(string id, string displayName, InputBinding binding, string category = null)
Parameters
idstringdisplayNamestringbindingInputBindingcategorystring
Returns
Exceptions
- ArgumentException
The binding has keyboard or gamepad axes.