InteractionInputAttribute

Method attribute that marks a method on an Interaction subclass as an input handler. Specifies an optional display name and which input phase to respond to. Used by InteractionInputTable for reflection-based callback discovery.

Definition

Namespace: Paragon.Townskeep.InteractionSystem Assembly: Townskeep.dll

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

Inherits: System.Attribute

Remarks

This attribute is the declarative entry point for the Interaction Input subsystem. When an InteractionInputTable is constructed or deserialized, it uses reflection to scan the owning Interaction subclass for methods bearing this attribute. Each discovered method becomes a callback on an InteractionInput entry.

The Name parameter controls the input's display name and dictionary key in the InteractionInputTable. If left empty (default), the method name is split from PascalCase into a human-readable form (e.g., OnChopTree"On Chop Tree").

Quick Lookup

Goal
How

Bind to default phase (performed)

[InteractionInput("ActionName")]

Bind to started phase

[InteractionInput("ActionName", InteractionInputPhase.STARTED)]

Bind to canceled phase

[InteractionInput("ActionName", InteractionInputPhase.CANCELED)]

Auto-name from method

[InteractionInput] — name derived from method name

Fields

Name

The display name and dictionary key for this input. If empty, defaults to the method name split from PascalCase.

InputPhase

The input action phase this handler responds to.

Defaults to InteractionInputPhase.PERFORMED.

Constructor

Parameter
Type
Description

name

string

Display name and lookup key. Empty string = auto-derived from method name.

inputPhase

InteractionInputPhase

Phase to subscribe to. Defaults to PERFORMED.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

Examples

Named inputs

Auto-named inputs

Multiple methods on the same input

See Also

Last updated