Class StateKeyWeightProviderSO
Weight provider that reads a StateKey value and applies an AnimationCurve mapping. This is NOT a StateKey definition—it references an existing UnityStateKey asset. The state value is normalized (0-1) before being passed through the curve.
Namespace: Serenity.ProceduralExpression.Infrastructure.WeightProviders
Assembly: Serenity.UnityProceduralExpression.Infrastructure.dll
Syntax
public class StateKeyWeightProviderSO : WeightProviderSO
Constructors
StateKeyWeightProviderSO()
Declaration
public StateKeyWeightProviderSO()
Properties
MappingCurve
Gets the mapping curve.
Declaration
public AnimationCurve MappingCurve { get; }
Property Value
| Type | Description |
|---|---|
| AnimationCurve |
SourceKey
Gets the source state key.
Declaration
public UnityStateKey SourceKey { get; }
Property Value
| Type | Description |
|---|---|
| UnityStateKey |
Methods
GetWeight(in UnityProceduralContext)
Gets the weight value for the given procedural context. Returns a value typically between 0-1, but can exceed these bounds.
Declaration
public override float GetWeight(in UnityProceduralContext ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityProceduralContext | ctx | The current procedural context with state values. |
Returns
| Type | Description |
|---|---|
| float | The computed weight value. |
Overrides
Validate()
Optional validation method for editor display. Returns null if valid, or an error message if invalid.
Declaration
public override string Validate()
Returns
| Type | Description |
|---|---|
| string |