logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class WeightProviderSO

    Abstract base class for providing weight values to layers via rules. Separates the "when" (Condition) from the "how much" (WeightProvider).

    Inheritance
    object
    WeightProviderSO
    ConstantWeightProviderSO
    StateKeyWeightProviderSO
    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
    In this article
    © 2026 Serenity. All Rights Reserved