public sealed class InputActionOne thing a player can do, and every way they can do it.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The unit the game codes against. A game asks Move.ReadValue<Vector2>() or listens for Performed; it never asks whether W is down, which is what makes rebinding, control schemes and device hot-swap possible at all.
Both APIs, and they are the same state. The event path drives UI, where a click has to be handled on the frame it happened; the polled path drives gameplay, where a simulation reads what is true now. Deriving one from the other — an event queue the gameplay code drains, or a poll the UI does — is where the two disagree by a frame.
One binding wins per frame for a Button or Value action: the one furthest from rest. Without that, a stick and WASD bound to the same action would sum to a magnitude of two when both are pushed, and a player who rests a hand on the pad while using the keyboard would drift.
Fields and properties (18)
public InputActionData DataWhat the asset said.
public string NameIts name, unique within its map.
public InputActionMap MapThe map it belongs to.
public InputActionType TypeWhat it does with its value.
public InputControlType ControlTypeThe shape of its value.
public string PathIts full name, Player/Move.
public IReadOnlyList<InputBinding> BindingsIts bindings.
public bool IsEnabledWhether it is listening.
public InputActionPhase PhaseWhere it is in its lifecycle.
public Vector2 ValueIts value, as of the last update.
public float MagnitudeHow far from rest it is.
public bool IsPressedWhether it is past its press point now.
public bool WasPressedThisFrameWhether it crossed the press point this frame.
public bool WasReleasedThisFrameWhether it fell below the press point this frame.
public bool WasPerformedThisFrameWhether an interaction was satisfied this frame.
public bool WasStartedThisFrameWhether an interaction began this frame.
public bool WasCanceledThisFrameWhether an interaction ended without being satisfied this frame.
public InputBinding? ActiveBindingThe binding that produced the current value, or .
Events (3)
public Action<InputActionContext>? StartedRaised when an interaction begins.
public Action<InputActionContext>? PerformedRaised when an interaction is satisfied. The one most games listen to.
public Action<InputActionContext>? CanceledRaised when an interaction ends without being satisfied, or the control is released.
Methods (7)
public T ReadValue<T>() where T : structReads the value as the shape the caller expects.
public float ReadFloat()Reads the value as one axis.
public Vector2 ReadVector2()Reads the value as two axes.
public void CollectControls(List<InputControl> into)Every control this action currently reads.
public void OverrideBinding(int bindingIndex, string? path, int partIndex = -1)Replaces the path a binding reads.
public void RemoveBindingOverrides()Puts every binding back to what the asset says.
public override string ToString()Returns a string that represents the current object.
Used by (14)
- MouseCaptureSystemThirdPersonShooter
- PlayerRigThirdPersonShooter
- ActionPlayerInputVixen.Engine
- GeneratedAccessorTestsVixen.Input.Tests
- InputActionContextVixen.Input
- InputActionMapVixen.Input
- InputActionTestsVixen.Input.Tests
- InputActionsVixen.Input
- InputBindingVixen.Input
- InputBindingConflictVixen.Input
- InputRebindingOperationVixen.Input
- InputRebindingTestsVixen.Input.Tests
- MenuActionsVixen.Input.Tests
- PlayerActionsVixen.Input.Tests