InputActionCallbackAttribute

Method attribute that marks a method as an input action handler. Specifies which input action to bind to and which phase to respond to. Used by InputActionMapBinding for reflection-based callback discovery.

Definition

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

[AttributeUsage(AttributeTargets.Method)]
public class InputActionCallbackAttribute : Attribute

Inherits: System.Attribute

Remarks

This attribute is the declarative core of the Input System binding framework. When InputActionMapBinding.Bind() is called, reflection scans the subclass for methods bearing this attribute and wires them up to the corresponding Unity InputAction events.

The attribute also carries [MeansImplicitUse] (JetBrains annotation), which tells IDE analyzers that the marked method is used even though it has no explicit call sites — suppressing "unused method" warnings.

Quick Lookup

Goal
How

Bind to default phase (performed)

[InputActionCallback("ActionName")]

Bind to started phase

[InputActionCallback("ActionName", InputActionPhase.STARTED)]

Bind to cancelled phase

[InputActionCallback("ActionName", InputActionPhase.CANCELLED)]

Fields

ActionName

The name of the input action to bind to. Must match an action name in the target InputActionMap.

InputPhase

The input action phase this handler responds to.

Defaults to InputActionPhase.PERFORMED.

Constructor

Parameter
Type
Description

actionName

string

Name of the input action in the InputActionMap

phase

InputActionPhase

Phase to subscribe to. Defaults to PERFORMED.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

Examples

Different phase bindings

Different method signatures

See Also

Last updated