logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    WeightProviderSO
    StateKeyWeightProviderSO
    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
    WeightProviderSO.GetWeight(in UnityProceduralContext)

    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
    Overrides
    WeightProviderSO.Validate()
    In this article
    © 2026 Serenity. All Rights Reserved