logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UnityHudThresholdRamp

    An element-owned ramp of value bands, each carrying the colour a threshold-capable representation switches to once the transformed value falls at or below the band's upper bound.

    Inheritance
    object
    UnityHudThresholdRamp
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    Namespace: Serenity.GameUi.Infrastructure.Settings
    Assembly: Serenity.UnityGameUi.Infrastructure.dll
    Syntax
    public sealed class UnityHudThresholdRamp
    Remarks

    Element-owned rather than per-representation, so the one ramp an author sets up keeps working across whichever textual, gauge or stack representation the element is drawn with. Ascending upper bounds, first-match-wins, no base colour — HudThresholdRules is the single place that model's semantics are defined; this type only carries the authored data and the colour lookup, mirroring the UnityHudIconSetRepresentation.IconEntry ordered-list idiom.

    Constructors

    UnityHudThresholdRamp()

    Declaration
    public UnityHudThresholdRamp()

    Properties

    EvaluatesAsCapacityRatio

    Whether bands are evaluated against value ÷ capacity rather than the raw value.

    Declaration
    public bool EvaluatesAsCapacityRatio { get; }
    Property Value
    Type Description
    bool

    HasBands

    Whether any band has been authored at all.

    Declaration
    public bool HasBands { get; }
    Property Value
    Type Description
    bool

    UpperBounds

    The authored upper bounds, in list order.

    Declaration
    public IReadOnlyList<double> UpperBounds { get; }
    Property Value
    Type Description
    IReadOnlyList<double>
    Remarks

    Null-safe: an element saved before this ramp existed deserializes bands as null, and this returns an empty list rather than throwing — the same "feature reads as fully off, no migration step" guarantee ChangeFeedbackDefinitionId gives a legacy element.

    Methods

    ColorForBand(int)

    The colour authored for the band at index.

    Declaration
    public Color ColorForBand(int index)
    Parameters
    Type Name Description
    int index

    A band index, as returned by HudThresholdRules.SelectBandIndex.

    Returns
    Type Description
    Color

    The band's authored colour, or white when the index is out of range.

    In this article
    © 2026 Serenity. All Rights Reserved