Extensions to help with dynamically rebinding InputAction in
various ways.
Inheritance
System.Object
InputActionRebindingExtensions
public static class InputActionRebindingExtensions
Methods
Declaration
public static void ApplyBindingOverride(this InputAction action, int bindingIndex, string path)
Parameters
Type |
Name |
Description |
InputAction |
action |
|
System.Int32 |
bindingIndex |
|
System.String |
path |
|
Declaration
public static void ApplyBindingOverride(this InputAction action, int bindingIndex, InputBinding bindingOverride)
Parameters
Declaration
public static void ApplyBindingOverride(this InputAction action, string newPath, string group = null, string path = null)
Parameters
Type |
Name |
Description |
InputAction |
action |
|
System.String |
newPath |
|
System.String |
group |
|
System.String |
path |
|
Declaration
public static void ApplyBindingOverride(this InputAction action, InputBinding bindingOverride)
Parameters
Declaration
public static void ApplyBindingOverride(this InputActionMap actionMap, int bindingIndex, InputBinding bindingOverride)
Parameters
Apply the given binding override to all bindings in the map that are matched by the override.
Declaration
public static int ApplyBindingOverride(this InputActionMap actionMap, InputBinding bindingOverride)
Parameters
Returns
Type |
Description |
System.Int32 |
The number of bindings overridden in the given map.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
actionMap is null .
|
System.InvalidOperationException |
actionMap is currently enabled.
|
Declaration
public static void ApplyBindingOverrides(this InputActionMap actionMap, IEnumerable<InputBinding> overrides)
Parameters
Declaration
public static int ApplyBindingOverridesOnMatchingControls(this InputAction action, InputControl control)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Declaration
public static int ApplyBindingOverridesOnMatchingControls(this InputActionMap actionMap, InputControl control)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Initiate an operation that interactively rebinds the given action based on received input.
Declaration
public static InputActionRebindingExtensions.RebindingOperation PerformInteractiveRebinding(this InputAction action)
Parameters
Type |
Name |
Description |
InputAction |
action |
Action to perform rebinding on.
|
Returns
Exceptions
Type |
Condition |
System.ArgumentNullException |
|
System.ArgumentException |
|
Declaration
public static void RemoveAllBindingOverrides(this InputAction action)
Parameters
Restore all bindings in the map to their defaults.
Declaration
public static void RemoveAllBindingOverrides(this InputActionMap actionMap)
Parameters
Type |
Name |
Description |
InputActionMap |
actionMap |
Action map to remove overrides from. Must not have enabled actions.
|
Exceptions
Type |
Condition |
System.ArgumentNullException |
actionMap is null .
|
System.InvalidOperationException |
actionMap is currently enabled.
|
Declaration
public static void RemoveBindingOverride(this InputAction action, InputBinding bindingOverride)
Parameters
Declaration
public static void RemoveBindingOverrides(this InputActionMap actionMap, IEnumerable<InputBinding> overrides)
Parameters