Class ProceduralActionSO
Base ScriptableObject for discrete procedural animation actions with lifecycle. Actions have a start, tick, and end phase, unlike continuous layers. Examples: recoil, flinch, stumble.
Namespace: Serenity.ProceduralExpression.Infrastructure.ProceduralActions
Assembly: Serenity.UnityProceduralExpression.Infrastructure.dll
Syntax
public abstract class ProceduralActionSO : ScriptableObject
Constructors
ProceduralActionSO()
Declaration
protected ProceduralActionSO()
Fields
cooldownSeconds
Declaration
protected float cooldownSeconds
Field Value
| Type | Description |
|---|---|
| float |
displayName
Declaration
protected string displayName
Field Value
| Type | Description |
|---|---|
| string |
minDurationSeconds
Declaration
protected float minDurationSeconds
Field Value
| Type | Description |
|---|---|
| float |
priority
Declaration
protected int priority
Field Value
| Type | Description |
|---|---|
| int |
Properties
CooldownSeconds
Gets the cooldown time in seconds.
Declaration
public float CooldownSeconds { get; }
Property Value
| Type | Description |
|---|---|
| float |
DisplayName
Gets the display name for this action.
Declaration
public string DisplayName { get; }
Property Value
| Type | Description |
|---|---|
| string |
MinDurationSeconds
Gets the minimum duration in seconds.
Declaration
public float MinDurationSeconds { get; }
Property Value
| Type | Description |
|---|---|
| float |
Priority
Gets the priority for interrupt handling.
Declaration
public int Priority { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
CanStart(in UnityProceduralContext)
Checks if this action can start given the current context. Override to add custom start conditions.
Declaration
public virtual bool CanStart(in UnityProceduralContext ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityProceduralContext | ctx |
Returns
| Type | Description |
|---|---|
| bool |
IsFinished(in UnityProceduralContext, ActionRuntimeState)
Checks if this action has finished.
Declaration
public abstract bool IsFinished(in UnityProceduralContext ctx, ActionRuntimeState runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityProceduralContext | ctx | The procedural context. |
| ActionRuntimeState | runtime | Runtime state for this action instance. |
Returns
| Type | Description |
|---|---|
| bool | True if the action should stop. |
OnStart(in UnityProceduralContext, ActionRuntimeState)
Called when the action starts. Override to initialize action-specific state.
Declaration
public abstract void OnStart(in UnityProceduralContext ctx, ActionRuntimeState runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityProceduralContext | ctx | The procedural context. |
| ActionRuntimeState | runtime | Runtime state for this action instance. |
OnStop(in UnityProceduralContext, ActionRuntimeState)
Called when the action ends. Override to clean up action-specific state.
Declaration
public virtual void OnStop(in UnityProceduralContext ctx, ActionRuntimeState runtime)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityProceduralContext | ctx | The procedural context. |
| ActionRuntimeState | runtime | Runtime state for this action instance. |
Tick(in UnityProceduralContext, ActionRuntimeState, ref PoseDelta)
Called every frame while the action is active. Adds the action's contribution to the pose delta.
Declaration
public abstract void Tick(in UnityProceduralContext ctx, ActionRuntimeState runtime, ref PoseDelta pose)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityProceduralContext | ctx | The procedural context. |
| ActionRuntimeState | runtime | Runtime state for this action instance. |
| PoseDelta | pose | The pose delta to add contributions to. |