InputActionPhase

Enum representing the phases of an input action lifecycle. Maps directly to Unity's UnityEngine.InputSystem.InputActionPhase values but uses Paragon naming conventions.

Definition

Namespace: Paragon.Core.InputSystem Assembly: Paragon.dll

public enum InputActionPhase

Remarks

This enum provides a Paragon-namespaced wrapper around Unity's InputActionPhase. The values are explicitly assigned to match their Unity counterparts, ensuring seamless interop. It is used by InputActionCallbackAttribute to specify which phase a handler method should respond to.

Values

Value
Unity Equivalent
Description

STARTED

InputActionPhase.Started

The action has been initiated (e.g., button pressed down)

PERFORMED

InputActionPhase.Performed

The action has been fully performed (e.g., button click completed, or continuous input threshold reached)

CANCELLED

InputActionPhase.Canceled

The action was cancelled (e.g., button released before interaction completed, or input stopped)

Usage

// Default — most handlers use PERFORMED
[InputActionCallback("Attack")]
private void OnAttack() { }

// Press detection — fires on initial press
[InputActionCallback("Jump", InputActionPhase.STARTED)]
private void OnJump() { }

// Release detection — fires when input stops
[InputActionCallback("Sprint", InputActionPhase.CANCELLED)]
private void OnSprintEnd() { }

Phase Lifecycle

circle-info

The exact timing of PERFORMED depends on the interaction type configured on the Unity InputAction. For a "Press" interaction, PERFORMED fires immediately on press. For a "Hold" interaction, PERFORMED fires after the hold duration elapses.

See Also

Last updated