Struct UnityProceduralContext
Unity-specific procedural context passed to all layers and actions.
Provides convenient access to state values via UnityStateKey references.
Assembly: Serenity.UnityProceduralAnimator.Infrastructure.dll
Syntax
public readonly struct UnityProceduralContext
Constructors
UnityProceduralContext(IStateReader, float, float)
Creates a new UnityProceduralContext. LayerTime defaults to
time, so behavior is unchanged for every existing caller.
Declaration
public UnityProceduralContext(IStateReader stateReader, float time, float deltaTime)
Parameters
UnityProceduralContext(IStateReader, float, float, float)
Creates a new UnityProceduralContext with an explicit layer-local time.
Declaration
public UnityProceduralContext(IStateReader stateReader, float time, float deltaTime, float layerTime)
Parameters
Fields
DeltaTime
Declaration
public readonly float DeltaTime
Field Value
LayerTime
Seconds since the owning layer was last activated (see
ProceduralAnimatorComponent.ActivateLayer). Equals Time for layers using
LayerPhaseMode.ABSOLUTE (the default) — only LayerPhaseMode.ON_ACTIVATE layers
read this instead of Time to drive their phase/step progression.
Declaration
public readonly float LayerTime
Field Value
StateReader
Reader for accessing state values from the state bus.
Declaration
public readonly IStateReader StateReader
Field Value
Time
Declaration
public readonly float Time
Field Value
Methods
GetState(StateKeyId, float)
Gets a state value by StateKeyId with optional default.
Declaration
public float GetState(StateKeyId key, float defaultValue = 0)
Parameters
Returns
GetState(UnityStateKey, float)
Gets a state value by UnityStateKey with optional default.
Declaration
public float GetState(UnityStateKey key, float defaultValue = 0)
Parameters
Returns
ToDomainContext()
Converts to domain ProceduralContext.
Declaration
public ProceduralContext ToDomainContext()
Returns
WithLayerTime(float)
Declaration
public UnityProceduralContext WithLayerTime(float layerTime)
Parameters
| Type |
Name |
Description |
| float |
layerTime |
|
Returns