logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class HudAnimationLayerScaffold

    Creates a starter ProceduralAnimator layer asset for a HUD element animation entry — a one-shot scale punch/pop-in or activation blink/strobe, or an ambient looping scale pulse/heartbeat or activation blink — prefilled so the entry is playable the moment the created asset lands on the row's Layer field. The Animation tab is unusable without this — authoring a sequence layer by hand, field by field, is exactly the friction a scaffold button exists to remove.

    Inheritance
    object
    HudAnimationLayerScaffold
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.GameUi.Infrastructure.Editor.Builder
    Assembly: Serenity.UnityGameUi.Infrastructure.Editor.dll
    Syntax
    public static class HudAnimationLayerScaffold
    Remarks

    Mirrors HudCreator's own asset-writing shape: build the instance, UnityEditor.AssetDatabase.CreateAsset(UnityEngine.Object,System.String), then save. phaseMode, repeatCount and each sequence layer's own transformId/steps are private or protected serialized fields with no public setter, so every write here goes through UnityEditor.SerializedObject — the same reason HudAnimationSequenceLayerInspector does.

    Methods

    CreateArcadeStrobe(string, string, string)

    A rapid arcade strobe: four off/on flashes at a fast, uniform tempo, then a final off step so the sequence ends hidden — a harsher, faster-cycling sibling of CreateBlink(string, string, string) for a retro "danger"/"game over" beat rather than a single attention-getting flash. Mirrors CreateBlink(string, string, string)'s odd-count, ends-hidden convention.

    Declaration
    public static ProceduralLayerSO CreateArcadeStrobe(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateBlink(string, string, string)

    An on/off blink: off, on, off, on, off.

    Declaration
    public static ProceduralLayerSO CreateBlink(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateDamageFlash(string, string, string)

    A white/red damage flash: two hits of red punctuated by white, settling back to white — the UiColor counterpart of CreateWiggle(string, string, string)'s rotation-based reaction, for a value that just decreased.

    Declaration
    public static ProceduralLayerSO CreateDamageFlash(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateFadeIn(string, string, string)

    A fade-in: fully transparent, blending up to fully opaque and settling — the classic "just appeared" motion for a UGUI Graphic, the UiColor counterpart of CreatePopIn(string, string, string)'s scale-based one. Pairs well with an ON_SHOW trigger on an element that starts hidden — see HudAnimationTemplateRegistry's entry for why this template also arms the row's own playsWhileHidden flag, unlike every other one-shot template.

    Declaration
    public static ProceduralLayerSO CreateFadeIn(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateGhostPulse(string, string, string)

    A gentle ambient alpha pulse: fully opaque breathing down to a low, still-visible alpha and back — looping continuously (Serenity.GameUi.Infrastructure.Editor.Builder.HudAnimationLayerScaffold.ConfigureAmbientLoop(UnityEditor.SerializedObject,System.String)) like CreatePulse(string, string, string), but fading instead of scaling — for a HUD element that should read as "alive" while idle without moving.

    Declaration
    public static ProceduralLayerSO CreateGhostPulse(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateHeartbeat(string, string, string)

    A two-beat heartbeat: two quick scale-ups back to back, then a longer hold at rest before repeating — looping continuously (Serenity.GameUi.Infrastructure.Editor.Builder.HudAnimationLayerScaffold.ConfigureAmbientLoop(UnityEditor.SerializedObject,System.String)) like CreatePulse(string, string, string), but with the lub-dub rhythm a single symmetric pulse can't give.

    Declaration
    public static ProceduralLayerSO CreateHeartbeat(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateInsertCoinBlink(string, string, string)

    A retro "insert coin" blink: on, off, looping continuously (Serenity.GameUi.Infrastructure.Editor.Builder.HudAnimationLayerScaffold.ConfigureAmbientLoop(UnityEditor.SerializedObject,System.String)) for as long as the element stays visible — an attract-mode flash rather than a one-shot reaction, which is why the template also arms the animation entry's playsWhileHidden flag (see HudAnimationTemplateRegistry).

    Declaration
    public static ProceduralLayerSO CreateInsertCoinBlink(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreatePopIn(string, string, string)

    A pop-in: starts small, overshoots past rest, then settles — the classic UI "just appeared" motion. All three steps blend into the next, so the sequence reads as one continuous ease rather than two discrete jumps.

    Declaration
    public static ProceduralLayerSO CreatePopIn(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreatePulse(string, string, string)

    A gentle ambient pulse: rest, breathe out to a slightly larger scale, and back — looping continuously (Serenity.GameUi.Infrastructure.Editor.Builder.HudAnimationLayerScaffold.ConfigureAmbientLoop(UnityEditor.SerializedObject,System.String)) rather than playing once, since the whole point is a subtle "still alive" motion that runs for as long as the element stays visible, not a reaction to a single trigger.

    Declaration
    public static ProceduralLayerSO CreatePulse(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateRetroSpin(string, string, string)

    A continuous retro spin: four evenly-spaced quarter turns, each blending into the next, looping forever (Serenity.GameUi.Infrastructure.Editor.Builder.HudAnimationLayerScaffold.ConfigureAmbientLoop(UnityEditor.SerializedObject,System.String)) — the classic arcade spinning pickup icon. Every step blends into the next, including the last back to the first: TransformRotationSequenceLayerSO's own wrap-seam rule unwraps that final blend by +360° instead of snapping backward, so the four 90°-apart steps read as one unbroken rotation rather than resetting at the seam.

    Declaration
    public static ProceduralLayerSO CreateRetroSpin(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateRumble(string, string, string)

    A jittery rumble: three quick side-to-side pairs of shrinking amplitude, back to rest — every step blends into the next (including the last, a harmless 0°→0° no-op blend into the wrap seam), for an impact/danger beat with more character than a single wiggle.

    Declaration
    public static ProceduralLayerSO CreateRumble(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateScalePunch(string, string, string)

    A short punch out then back: rest scale, punched scale held, then a blend back down that wraps to the first step — the sequence layer's own modulo-indexed blend, not a fourth authored step.

    Declaration
    public static ProceduralLayerSO CreateScalePunch(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateShake(string, string, string)

    A quick side-to-side shake: rest, four shrinking-then-varying kicks, back to rest — the position counterpart of CreateWiggle(string, string, string)'s rotation-based shake, for a root-level element that just took a hit or needs a "no" nudge.

    Declaration
    public static ProceduralLayerSO CreateShake(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateSlideIn(string, string, string)

    A slide-in entrance: starts off-screen to the left, slides in and settles at rest — the classic "just appeared" motion for a root-level HUD box, the position counterpart of CreatePopIn(string, string, string)'s scale-based one. Root-level only: see TransformPositionSequenceLayerSO's own remarks on why a parented element never actually moves.

    Declaration
    public static ProceduralLayerSO CreateSlideIn(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    CreateWiggle(string, string, string)

    A quick shake reaction: rest, cross past one side then the other, and back to rest — a short ON_ACTIVATE beat for a value that just took a hit or needs a "no" nudge, the rotation counterpart of CreateScalePunch(string, string, string)'s one-shot reaction shape. Unlike CreateScalePunch(string, string, string)'s wrap-back last step, the final step here holds at rest without blending — there is nothing after it in a one-shot sequence for a wraparound to usefully blend toward.

    Declaration
    public static ProceduralLayerSO CreateWiggle(string outputFolder, string hudId, string owningElementId)
    Parameters
    Type Name Description
    string outputFolder

    Folder to create the asset in.

    string hudId

    The HUD's id, folded into the generated file name.

    string owningElementId

    The id of the element the animation entry lives on — the layer's baked transformId should equal it.

    Returns
    Type Description
    ProceduralLayerSO

    The created, saved layer asset.

    In this article
    © 2026 Serenity. All Rights Reserved