logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class HudAnimationTemplateRegistry

    The animation templates offered by the animation row's "Choose an animation" gallery and its "New" dropdown: a small, hand-picked list of starter layers an author can create in one click, plus the seam for adding more.

    Inheritance
    object
    HudAnimationTemplateRegistry
    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 HudAnimationTemplateRegistry
    Remarks

    The hand-written entries are the load-bearing content here — not their DisplayName (which is now always the layer type's own real name; see Serenity.GameUi.Infrastructure.Editor.Builder.HudAnimationTemplateRegistry.ResolveDisplayName(System.Type)), but Description: the prose that tells an author which of two similar-sounding scaffolds to reach for ("plays once and settles" versus "flashes and ends hidden") and the starter content (steps) each one bakes in. That sentence cannot be inferred from the factory method's signature or the layer type it returns, which is why this list is still written by hand rather than generated wholesale from a Type scan or a JSON table.

    Register(Template) is the extension seam for a future template kind with its own curated starter content and description — a UI-colour layer template, say. A future contributor should call Register(Template) from their own module's static constructor (or any static-initialization seam) to add an entry.

    All additionally backfills a plain, undescribed entry for any HUD-compatible layer type (see Serenity.GameUi.Infrastructure.Editor.Builder.ProceduralLayerHudCompatibility) that has no hand-written entry above — a safety net, not a replacement for the hand-written list: it exists so a future HUD-compatible layer type still shows up in the "New" menu the moment it is declared HUD-compatible, rather than being invisible until someone remembers to add a HudAnimationTemplateRegistry.Template for it by hand. Today both known HUD-compatible types (TransformScaleSequenceLayerSO, ActivationSequenceLayerSO) already have a hand-written entry, so this backfill is a no-op in practice.

    Properties

    All

    Every registered template, in registration order, followed by a plain backfill entry for any HUD-compatible layer type with no hand-written entry above (see the class remarks). Computed fresh on every access — cheap: Serenity.GameUi.Infrastructure.Editor.Builder.ProceduralLayerHudCompatibility.HudCompatibleLayerTypes scans a UnityEditor.TypeCache table Unity already keeps warm, and per-type channel reads are themselves cached for the editor session.

    Declaration
    public static IReadOnlyList<HudAnimationTemplateRegistry.Template> All { get; }
    Property Value
    Type Description
    IReadOnlyList<HudAnimationTemplateRegistry.Template>

    Methods

    Register(Template)

    Adds a template to the gallery. The extension seam described in the class remarks — call this from a static constructor (or any static-initialization seam) to register a new template kind.

    Declaration
    public static void Register(HudAnimationTemplateRegistry.Template template)
    Parameters
    Type Name Description
    HudAnimationTemplateRegistry.Template template

    The template to add; a no-op when null.

    Exceptions
    Type Condition
    ArgumentException

    template.LayerType is null — All's backfill relies on every registered template naming the concrete layer type it creates to tell which HUD-compatible types are already covered by a hand-written entry; a template with no LayerType would make that type invisible to the dedup check and risk a duplicate backfill entry for it. Also thrown when PresetLabel is null or empty — a hand-written template with no preset label would render as MenuLabel's bare-DisplayName fallback, indistinguishable in the gallery/menu from any other hand-written template sharing the same LayerType.

    In this article
    © 2026 Serenity. All Rights Reserved