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.
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)
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)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | ctx | The procedural context containing state and time information. |
Returns
| Type | Description |
|---|---|
| bool | True if the action is finished, false if it should continue. |
OnStart(in TContext)
Called when the action starts. Use this to initialize action state.
Declaration
void OnStart(in TContext ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | ctx | The procedural context containing state and time information. |
OnStop(in TContext)
Called when the action ends (either naturally or when interrupted). Use this to clean up action state.
Declaration
void OnStop(in TContext ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | ctx | The procedural context containing state and time information. |
Tick(in TContext, 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, ref PoseDelta pose)
Parameters
| Type | Name | Description |
|---|---|---|
| TContext | ctx | The procedural context containing state and time information. |
| PoseDelta | pose | The pose delta to add contributions to. |