An action set represents a set of actions, usually for a single player. This class must be subclassed to be used. An action set can contain both explicit, bindable single value actions (for example, "Jump", "Left" and "Right") and implicit, aggregate actions which combine together other actions into one or two axes, for example "Move", which might consist of "Left", "Right", "Up" and "Down" filtered into a single two-axis control with its own applied circular deadzone, queryable vector value, etc.
More...
|
void | Destroy () |
| Properly dispose of this action set. You should make sure to call this when the action set will no longer be used or it will result in unnecessary internal processing every frame. More...
|
|
PlayerAction | GetPlayerActionByName (string actionName) |
| Gets the action with the specified action name. If the action does not exist, it returns null . More...
|
|
void | Reset () |
| Reset the bindings on all actions in this set. More...
|
|
void | ClearInputState () |
|
bool | HasBinding (BindingSource binding) |
| Searches all the bindings on all the actions on this set to see if any match the provided binding object. More...
|
|
void | RemoveBinding (BindingSource binding) |
| Searches all the bindings on all the actions on this set to see if any match the provided binding object and, if found, removes it. More...
|
|
byte[] | SaveData () |
| Returns the state of this action set and all bindings encoded into a byte array that you can save somewhere. Pass this string to LoadData() to restore the state of this action set. More...
|
|
void | LoadData (byte[] data) |
| Load a state returned by calling SaveBytes() at a prior time. More...
|
|
string | Save () |
| Returns the state of this action set and all bindings encoded into a string that you can save somewhere. Pass this string to Load() to restore the state of this action set. More...
|
|
void | Load (string data) |
| Load a state returned by calling Save() at a prior time. More...
|
|
|
InputDevice | Device [get, set] |
| Optionally specifies a device which this action set should query from, if applicable. When set to null (default) this action set will try to find an active device when required. More...
|
|
List< InputDevice > | IncludeDevices [get] |
| A list of devices which this action set should include when searching for an active device. When empty, all attached devices will be considered. More...
|
|
List< InputDevice > | ExcludeDevices [get] |
| A list of devices which this action set should exclude when searching for an active device. More...
|
|
ReadOnlyCollection< PlayerAction > | Actions [get] |
| Gets the actions in this action set as a readonly collection. More...
|
|
ulong | UpdateTick [get, protected set] |
| The last update tick on which any action in this set changed value. More...
|
|
bool | Enabled [get, set] |
| Whether this action set should produce input. Default: true More...
|
|
bool | PreventInputWhileListeningForBinding [get, set] |
| The prevent input to all actions while any action in the set is listening for a binding. More...
|
|
object | UserData [get, set] |
| This property can be used to store whatever arbitrary game data you want on this action set. More...
|
|
PlayerAction | this[string actionName] [get] |
| Gets the action with the specified action name. If the action does not exist, KeyNotFoundException is thrown. More...
|
|
bool | IsListeningForBinding [get] |
| Query whether any action in this set is currently listening for a new binding. More...
|
|
BindingListenOptions?? | ListenOptions [get, set] |
| Configures how in an action in this set listens for new bindings when the action does not explicitly define its own listen options. More...
|
|
InputDevice?? | ActiveDevice [get] |
| Gets the currently active device (controller) if present, otherwise returns a null device which does nothing. The currently active device is defined as the last device that provided input to an action on this set. When LastInputType is not a device (controller), this will return the null device. More...
|
|
|
Action< BindingSourceType > | OnLastInputTypeChanged |
| Occurs when the binding source type that last provided input to this action set changes. More...
|
|
An action set represents a set of actions, usually for a single player. This class must be subclassed to be used. An action set can contain both explicit, bindable single value actions (for example, "Jump", "Left" and "Right") and implicit, aggregate actions which combine together other actions into one or two axes, for example "Move", which might consist of "Left", "Right", "Up" and "Down" filtered into a single two-axis control with its own applied circular deadzone, queryable vector value, etc.
◆ CreateOneAxisPlayerAction()
Create an aggregate, single-axis action on this set. This should be performed in the constructor of your PlayerActionSet subclass.
PlayerOneAxisAction CreateOneAxisPlayerAction(PlayerAction negativeAction, PlayerAction positiveAction)
Create an aggregate, single-axis action on this set. This should be performed in the constructor of y...
Definition: PlayerActionSet.cs:153
- Parameters
-
negativeAction | The action to query for the negative component of the axis. |
positiveAction | The action to query for the positive component of the axis. |
◆ CreatePlayerAction()
Create an action on this set. This should be performed in the constructor of your PlayerActionSet subclass.
- Parameters
-
name | A unique identifier for this action within the context of this set. |
- Exceptions
-
InControlException | Thrown when trying to create an action with a non-unique name for this set. |
◆ CreateTwoAxisPlayerAction()
Create an aggregate, double-axis action on this set. This should be performed in the constructor of your PlayerActionSet subclass.
Note that, due to Unity's positive up-vector, the parameter order of negativeYAction
and positiveYAction
might seem counter-intuitive.
PlayerTwoAxisAction CreateTwoAxisPlayerAction(PlayerAction negativeXAction, PlayerAction positiveXAction, PlayerAction negativeYAction, PlayerAction positiveYAction)
Create an aggregate, double-axis action on this set. This should be performed in the constructor of y...
Definition: PlayerActionSet.cs:174
- Parameters
-
negativeXAction | The action to query for the negative component of the X axis. |
positiveXAction | The action to query for the positive component of the X axis. |
negativeYAction | The action to query for the negative component of the Y axis. |
positiveYAction | The action to query for the positive component of the Y axis. |
◆ Destroy()
Properly dispose of this action set. You should make sure to call this when the action set will no longer be used or it will result in unnecessary internal processing every frame.
◆ GetPlayerActionByName()
Gets the action with the specified action name. If the action does not exist, it returns null
.
- Parameters
-
actionName | The name of the action to get. |
◆ HasBinding()
Searches all the bindings on all the actions on this set to see if any match the provided binding object.
- Returns
true
, if a matching binding is found on any action on this set, false
otherwise.
- Parameters
-
◆ Load()
Load a state returned by calling Save() at a prior time.
- Parameters
-
◆ LoadData()
void LoadData |
( |
byte[] |
data | ) |
|
Load a state returned by calling SaveBytes() at a prior time.
- Parameters
-
◆ RemoveBinding()
Searches all the bindings on all the actions on this set to see if any match the provided binding object and, if found, removes it.
- Parameters
-
◆ Reset()
Reset the bindings on all actions in this set.
◆ Save()
Returns the state of this action set and all bindings encoded into a string that you can save somewhere. Pass this string to Load() to restore the state of this action set.
◆ SaveData()
Returns the state of this action set and all bindings encoded into a byte array that you can save somewhere. Pass this string to LoadData() to restore the state of this action set.
◆ LastDeviceClass
InputDeviceClass LastDeviceClass = InputDeviceClass.Unknown |
The InputDeviceClass of the binding source that last provided input to this action set.
◆ LastDeviceStyle
InputDeviceStyle LastDeviceStyle = InputDeviceStyle.Unknown |
The InputDeviceStyle of the binding source that last provided input to this action set.
◆ LastInputType
BindingSourceType LastInputType = BindingSourceType.None |
The binding source type that last provided input to this action set.
◆ LastInputTypeChangedTick
ulong LastInputTypeChangedTick |
◆ Actions
Gets the actions in this action set as a readonly collection.
◆ ActiveDevice
Gets the currently active device (controller) if present, otherwise returns a null device which does nothing. The currently active device is defined as the last device that provided input to an action on this set. When LastInputType is not a device (controller), this will return the null device.
◆ Device
Optionally specifies a device which this action set should query from, if applicable. When set to null
(default) this action set will try to find an active device when required.
◆ Enabled
Whether this action set should produce input. Default: true
◆ ExcludeDevices
A list of devices which this action set should exclude when searching for an active device.
◆ IncludeDevices
A list of devices which this action set should include when searching for an active device. When empty, all attached devices will be considered.
◆ IsListeningForBinding
bool IsListeningForBinding |
|
get |
Query whether any action in this set is currently listening for a new binding.
◆ ListenOptions
Configures how in an action in this set listens for new bindings when the action does not explicitly define its own listen options.
◆ PreventInputWhileListeningForBinding
bool PreventInputWhileListeningForBinding |
|
getset |
The prevent input to all actions while any action in the set is listening for a binding.
◆ this[string actionName]
Gets the action with the specified action name. If the action does not exist, KeyNotFoundException
is thrown.
- Parameters
-
actionName | The name of the action to get. |
◆ UpdateTick
The last update tick on which any action in this set changed value.
◆ UserData
This property can be used to store whatever arbitrary game data you want on this action set.
◆ OnLastInputTypeChanged
Action<BindingSourceType> OnLastInputTypeChanged |
Occurs when the binding source type that last provided input to this action set changes.
The documentation for this class was generated from the following file:
- Assets/InControl/Source/Binding/PlayerActionSet.cs