logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class UiColorDelta

    Represents a collection of UGUI Graphic tint changes for procedural animation. Analogous to ActivationDelta but for a UGUI Graphic's color instead of GameObject activation.

    Why TransformId: this deliberately reuses TransformId as the dictionary key, exactly as ActivationDelta's own remarks explain for activation targets — a UiColor target is still just a named target within this animator's world (a HUD element id), so a distinct id type would only duplicate TransformId's shape for no additional type safety.

    Combination Semantics: Uses last-write-wins per TransformId. When combining two UiColorDeltas, entries from the other delta overwrite existing entries with the same TransformId. This is deterministic given consistent ordering.

    Weight is the deliberate exception to the transform-facet convention. Every TransformDelta facet (scale/rotation/position) has the WRITER pre-blend its own value toward identity by weight before writing the entry, because each facet's identity (1, 0, Vector3.zero) is known without consulting the target. A Graphic's "identity" tint is its OWN CURRENT BASE COLOR — a value only the applier (UnityGraphicColorApplier), which actually holds the registered Graphic, ever knows. So for UiColor the applier itself performs Color.Lerp(Base, Base * Tint, Weight) — Weight on this entry is read and consumed by the applier, unlike its transform-facet counterparts. This mirrors how MaterialDelta.SetColor/UnityMaterialApplier already defer weight-blending to the applier for the same reason (a material's original color is likewise only known at the applier).

    Inheritance
    object
    UiColorDelta
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.ProceduralAnimator.Domain.Entities
    Assembly: Serenity.ProceduralAnimator.Domain.dll
    Syntax
    public class UiColorDelta

    Constructors

    UiColorDelta()

    Creates an empty UiColorDelta with no entries.

    Declaration
    public UiColorDelta()

    Properties

    Count

    Gets the number of entries in this delta.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    IsEmpty

    Checks if this delta has any entries.

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

    Methods

    Clear()

    Clears all tint entries.

    Declaration
    public void Clear()

    Clone()

    Creates a deep copy of this UiColorDelta.

    Declaration
    public UiColorDelta Clone()
    Returns
    Type Description
    UiColorDelta

    A new UiColorDelta with the same entries.

    Combine(UiColorDelta)

    Combines another UiColorDelta into this one using last-write-wins semantics. Entries from the other delta overwrite existing entries with the same TransformId.

    Declaration
    public void Combine(UiColorDelta other)
    Parameters
    Type Name Description
    UiColorDelta other

    The UiColorDelta to merge into this one.

    GetEntries()

    Gets all tint entries for applier access.

    Declaration
    public IReadOnlyDictionary<TransformId, UiColorEntry> GetEntries()
    Returns
    Type Description
    IReadOnlyDictionary<TransformId, UiColorEntry>

    Read-only dictionary of TransformId to UiColorEntry.

    Scale(float)

    Scales every entry's weight by the given factor. Exists for API parity with the other deltas' own Scale methods (Scale(float), Scale(float), Scale(float)) — like theirs, it is not currently called anywhere in the animator's own layer-blending pass.

    Declaration
    public void Scale(float weight)
    Parameters
    Type Name Description
    float weight

    The weight multiplier (0-1).

    SetTint(TransformId, ColorRGBA, float)

    Sets the desired tint for a UiColor target. If an entry already exists for this TransformId, it is overwritten.

    Declaration
    public void SetTint(TransformId id, ColorRGBA tint, float weight = 1)
    Parameters
    Type Name Description
    TransformId id

    The UiColor target identifier (a HUD element id).

    ColorRGBA tint

    The tint to multiply the target's base color by (white = no change).

    float weight

    Blend weight (0-1), consumed by the applier — see this class's own remarks. Default is 1 (full application).

    In this article
    © 2026 Serenity. All Rights Reserved