Interface IProceduralAction<TContext>
Interface for discrete procedural animation actions with lifecycle (e.g., recoil, flinch, stumble). Actions have a start, tick, and end phase, unlike continuous layers. Each active action instance carries an ActionRuntimeState that persists across ticks.
Namespace: Serenity.ProceduralExpression.Application.Interfaces
Assembly: Serenity.ProceduralExpression.Application.dll
Syntax
public interface IProceduralAction<TContext>
Type Parameters
| Name | Description |
|---|---|
| TContext | The type of procedural context used by the implementation. |
Methods
CanStart(in TContext)
Checks if this action can start given the current context. Used by the rules system to determine if the action should be triggered.
Declaration
bool CanStart(in TContext ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | ctx | The procedural context containing state and time information. |
Returns
| Type | Description |
|---|---|
| bool | True if the action can start, false otherwise. |
IsFinished(in TContext, ActionRuntimeState)
Checks if this action has finished. The animator will call OnStop and deactivate the action when this returns true.
Declaration
bool IsFinished(in TContext ctx, ActionRuntimeState runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | ctx | The procedural context containing state and time information. |
| ActionRuntimeState | runtime | Runtime state for this action instance. |
Returns
| Type | Description |
|---|---|
| bool | True if the action is finished, false if it should continue. |
OnStart(in TContext, ActionRuntimeState)
Called when the action starts. Use this to initialize action state.
Declaration
void OnStart(in TContext ctx, ActionRuntimeState runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | ctx | The procedural context containing state and time information. |
| ActionRuntimeState | runtime | Runtime state for this action instance. |
OnStop(in TContext, ActionRuntimeState)
Called when the action ends (either naturally or when interrupted). Use this to clean up action state.
Declaration
void OnStop(in TContext ctx, ActionRuntimeState runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | ctx | The procedural context containing state and time information. |
| ActionRuntimeState | runtime | Runtime state for this action instance. |
Tick(in TContext, ActionRuntimeState, ref PoseDelta)
Called every frame while the action is active. Adds the action's contribution to the pose delta.
Declaration
void Tick(in TContext ctx, ActionRuntimeState runtime, ref PoseDelta pose)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | ctx | The procedural context containing state and time information. |
| ActionRuntimeState | runtime | Runtime state for this action instance. |
| PoseDelta | pose | The pose delta to add contributions to. |