Class DefaultInputActions
A default InputAction setup.
Namespace: UnityEngine.InputSystem
Syntax
public class DefaultInputActions : object, IInputActionCollection2, IInputActionCollection, IEnumerable<InputAction>, IDisposable
Remarks
This class is auto-generated from the DefaultAction.inputactions
asset that comes with the Input System.
// Instantiate the default action set.
var actions = new DefaultInputActions();
// One way to use the actions:
actions.Player.Enable();
actions.Player.Fire.performed += _ => Fire();
// Or:
if (actions.Player.Fire.WasPressedThisFrame())
Fire();
// Another way is with PlayerInput, for example:
var playerInput = AddComponent<PlayerInput>();
playerInput.actions = actions.asset;
Constructors
DefaultInputActions()
Declaration
public DefaultInputActions()
Properties
asset
Declaration
public InputActionAsset asset { get; }
Property Value
Type | Description |
---|---|
InputActionAsset |
bindingMask
Declaration
public InputBinding? bindingMask { get; set; }
Property Value
Type | Description |
---|---|
Nullable<InputBinding> |
Implements
bindings
Declaration
public IEnumerable<InputBinding> bindings { get; }
Property Value
Type | Description |
---|---|
IEnumerable<InputBinding> |
Implements
controlSchemes
Declaration
public ReadOnlyArray<InputControlScheme> controlSchemes { get; }
Property Value
Type | Description |
---|---|
ReadOnlyArray<InputControlScheme> |
Implements
devices
Declaration
public ReadOnlyArray<InputDevice>? devices { get; set; }
Property Value
Type | Description |
---|---|
Nullable<ReadOnlyArray<InputDevice>> |
Implements
GamepadScheme
Declaration
public InputControlScheme GamepadScheme { get; }
Property Value
Type | Description |
---|---|
InputControlScheme |
JoystickScheme
Declaration
public InputControlScheme JoystickScheme { get; }
Property Value
Type | Description |
---|---|
InputControlScheme |
KeyboardMouseScheme
Declaration
public InputControlScheme KeyboardMouseScheme { get; }
Property Value
Type | Description |
---|---|
InputControlScheme |
Player
Declaration
public DefaultInputActions.PlayerActions Player { get; }
Property Value
Type | Description |
---|---|
DefaultInputActions.PlayerActions |
TouchScheme
Declaration
public InputControlScheme TouchScheme { get; }
Property Value
Type | Description |
---|---|
InputControlScheme |
UI
Declaration
public DefaultInputActions.UIActions UI { get; }
Property Value
Type | Description |
---|---|
DefaultInputActions.UIActions |
XRScheme
Declaration
public InputControlScheme XRScheme { get; }
Property Value
Type | Description |
---|---|
InputControlScheme |
Methods
Contains(InputAction)
Declaration
public bool Contains(InputAction action)
Parameters
Type | Name | Description |
---|---|---|
InputAction | action |
Returns
Type | Description |
---|---|
Boolean |
Implements
Disable()
Declaration
public void Disable()
Implements
Dispose()
Declaration
public void Dispose()
Enable()
Declaration
public void Enable()
Implements
FindAction(String, Boolean)
Declaration
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
Parameters
Type | Name | Description |
---|---|---|
String | actionNameOrId | |
Boolean | throwIfNotFound |
Returns
Type | Description |
---|---|
InputAction |
Implements
FindBinding(InputBinding, out InputAction)
Declaration
public int FindBinding(InputBinding bindingMask, out InputAction action)
Parameters
Type | Name | Description |
---|---|---|
InputBinding | bindingMask | |
InputAction | action |
Returns
Type | Description |
---|---|
Int32 |
Implements
GetEnumerator()
Declaration
public IEnumerator<InputAction> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<InputAction> |