Struct InputActionState
The state of one input action for one frame.
public readonly struct InputActionState
- Inherited Members
Constructors
InputActionState(string, InputActionType, bool, bool, float, float, bool, InputDeviceSource)
Creates the state of an action. Input code creates these.
public InputActionState(string actionId, InputActionType actionType, bool isPressed, bool wasPressed, float value, float previousValue, bool isConsumed, InputDeviceSource device)
Parameters
actionIdstringactionTypeInputActionTypeisPressedboolwasPressedboolvaluefloatpreviousValuefloatisConsumedbooldeviceInputDeviceSource
Properties
ActionId
The id of the action, as it was registered.
public string ActionId { get; }
Property Value
ActionType
Whether the action is a button or an axis.
public InputActionType ActionType { get; }
Property Value
Device
The device the value came from.
public InputDeviceSource Device { get; }
Property Value
IsConsumed
Whether the action has already been consumed this frame.
public bool IsConsumed { get; }
Property Value
IsPressed
Whether the action is down this frame.
public bool IsPressed { get; }
Property Value
PreviousValue
The action's value the frame before.
public float PreviousValue { get; }
Property Value
Value
The action's value this frame. A button gives 0 or 1; an axis gives its current amount.
public float Value { get; }
Property Value
WasJustPressed
Whether the action went down this frame.
public bool WasJustPressed { get; }
Property Value
WasJustReleased
Whether the action went up this frame.
public bool WasJustReleased { get; }
Property Value
WasPressed
Whether the action was down the frame before.
public bool WasPressed { get; }