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
    Implements
    IWeightProvider<UnityProceduralContext>
    IFoundationSettings
    Namespace: Serenity.ProceduralAnimator.Infrastructure.WeightProviders
    Assembly: Serenity.UnityProceduralAnimator.Infrastructure.dll
    Syntax
    public abstract class WeightProviderSO : ScriptableObject, IWeightProvider<UnityProceduralContext>, IFoundationSettings

    Constructors

    WeightProviderSO()

    Declaration
    protected WeightProviderSO()

    Fields

    Guid

    Declaration
    public string Guid
    Field Value
    Type Description
    string

    GUID for this weight provider asset.

    Id

    Declaration
    public string Id
    Field Value
    Type Description
    string

    Unique identifier for this weight provider asset.

    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

    Implements

    IWeightProvider<TContext>
    IFoundationSettings
    In this article
    © 2026 Serenity. All Rights Reserved