Class WeightProviderSO
Abstract base class for providing weight values to layers via rules. Separates the "when" (Condition) from the "how much" (WeightProvider).
Namespace: Serenity.ProceduralExpression.Infrastructure.WeightProviders
Assembly: Serenity.UnityProceduralExpression.Infrastructure.dll
Syntax
public abstract class WeightProviderSO : ScriptableObject
Constructors
WeightProviderSO()
Declaration
protected WeightProviderSO()
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 abstract 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. |
Validate()
Optional validation method for editor display. Returns null if valid, or an error message if invalid.
Declaration
public virtual string Validate()
Returns
| Type | Description |
|---|---|
| string |