Enum InputActionPhase
Trigger phase of an Input
Namespace: UnityEngine .InputSystem
Assembly: Unity.InputSystem.dll
Syntax
public enum InputActionPhase
Remarks
Actions can be triggered in steps. For example, a 'slow tap' will put an action into Started phase when a button the action is bound to is pressed. At that point, however, the action still has to wait for the expiration of a timer in order to make it a 'slow tap'. If the button is release before the timer expires, the action will be Canceled whereas if the button is held long enough, the action will be Performed.
Fields
Name | Description |
---|---|
Canceled | The action has stopped. Leads to canceled getting called. By default, a Button action cancels when a control falls back below the button
press threshold (see default An action will also get canceled when it is disabled while in progress (see Disable()).
Also, when an Input Note that interactions (see IInput |
Disabled | The action is not enabled. |
Performed | The action has been performed. Leads to performed getting called. By default, a Button action performs when a control crosses the button
press threshold (see default Note that interactions (see IInput For a given action, finding out whether it was performed in the current frame can be done with Was
|
Started | An associated control has been actuated such that it may lead to the action being triggered. Will lead to started getting called. This phase will only be invoked if there are interactions on the respective control binding. Without any interactions, an action will go straight from Waiting into Performed and back into Waiting whenever an associated control changes value. An example of an interaction that uses the Started phase is Slow Started can be useful for UI feedback. For example, in a game where the weapon can be charged, UI feedback can be initiated when the action is Started.
By default, an action is started as soon as a control moves away from its default value. This is
the case for both Button actions (which, however, does not yet have to mean
that the button press threshold has been reached; see default For Value actions, Note that interactions (see IInput |
Waiting | The action is enabled and waiting for input on its associated controls. This is the phase that an action goes back to once it has been Performed or Canceled. |