logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityStateKey

    ScriptableObject representing a state key in the procedural animation system. State keys are the foundation of the key-based state system. All animation behaviors are driven by StateKey → float mappings.

    Inheritance
    object
    UnityStateKey
    Namespace: Serenity.ProceduralExpression.Infrastructure.Settings
    Assembly: Serenity.UnityProceduralExpression.Infrastructure.dll
    Syntax
    public class UnityStateKey : ScriptableObject

    Constructors

    UnityStateKey()

    Declaration
    public UnityStateKey()

    Properties

    DebugColor

    Gets the debug visualization color.

    Declaration
    public Color DebugColor { get; }
    Property Value
    Type Description
    Color

    DisplayName

    Gets the human-readable display name.

    Declaration
    public string DisplayName { get; }
    Property Value
    Type Description
    string

    Id

    Gets the stable GUID identifier for this state key.

    Declaration
    public string Id { get; }
    Property Value
    Type Description
    string

    MaxValue

    Gets the maximum expected value.

    Declaration
    public float MaxValue { get; }
    Property Value
    Type Description
    float

    MinValue

    Gets the minimum expected value.

    Declaration
    public float MinValue { get; }
    Property Value
    Type Description
    float

    RangeHint

    Gets the expected value range (min, max).

    Declaration
    public Vector2 RangeHint { get; }
    Property Value
    Type Description
    Vector2

    Methods

    Clamp(float)

    Clamps a value to this state key's range hint.

    Declaration
    public float Clamp(float value)
    Parameters
    Type Name Description
    float value

    The value to clamp.

    Returns
    Type Description
    float

    The clamped value.

    Normalize(float)

    Normalizes a value to 0-1 based on this state key's range hint.

    Declaration
    public float Normalize(float value)
    Parameters
    Type Name Description
    float value

    The value to normalize.

    Returns
    Type Description
    float

    The normalized value (0-1).

    ToStateKeyId()

    Converts to domain StateKeyId.

    Declaration
    public StateKeyId ToStateKeyId()
    Returns
    Type Description
    StateKeyId

    Operators

    implicit operator StateKeyId(UnityStateKey)

    Implicit conversion to StateKeyId for convenience.

    Declaration
    public static implicit operator StateKeyId(UnityStateKey key)
    Parameters
    Type Name Description
    UnityStateKey key
    Returns
    Type Description
    StateKeyId
    In this article
    © 2026 Serenity. All Rights Reserved