logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.Ui.Infrastructure.Editor.Builder

    Classes

    CompositeNavPathRewriter

    The composite-child transition-path rewrite algorithm, extracted out of UnityCompositeViewDefinitionEditor so the CustomEditor only drives the "what changed" detection while this class owns the "::"-path segment algebra. Lives beside CompositeNavWiring (which already centralizes the same separator/path conventions for the builder) rather than in Business/Ui: RewriteMenuTransitionSegment(string, string, string) is inherently editor tooling (it walks and mutates UnityEditor.SerializedObjects across the project via UnityEditor.AssetDatabase), so the class as a whole cannot be engine-agnostic even though its innermost helper, RewriteChildSegment(string, string, string, string), is pure string logic. Splitting just that one pure method into Business would separate the rule from the only code that exercises it, without giving any other consumer (runtime only walks paths via UnityMenuView.Actions; nothing else rewrites them) a reason to depend on it — so this stays extract-only, editor-side.

    CompositeNavWiring

    Pure helpers for the navigation strings the builder writes into generated menus: composite-child transition paths and id sanitization. Centralized so the generator and (later) the composite inspector's child-swap rewrite share one source of truth.

    CompositeViewBuilderWindow

    Visual authoring window for composite-view screens: pick a layout template, name the sections, and Generate — the tool creates the composite + menu assets with navigation fully wired, hiding the manual transition plumbing. Menu: Serenity ▸ UI ▸ Composite View Builder.

    CompositeViewGenerator

    Turns a ContainerNode region tree (from TemplateBuilder) into the actual asset graph: generated menu definitions, nested composite definitions, and the root composite, with navigation wired. Children are created before parents (parents reference child assets), ids are pre-checked for collisions, and a failure rolls back every asset created in the run.

    CompositeViewGenerator.Result

    Outcome of a Generate(ContainerNode, string, bool, bool, string) run.

    CompositeWireframeDrawer

    Draws a flexbox wireframe of a IRegionNode tree into an IMGUI rect, so the builder window can show a live thumbnail of the chosen template. Leaves are labelled boxes; a switcher shows its first/active View with a marker. Project convention: ROW stacks vertically, COLUMN side-by-side.

    ContainerNode

    A container region realized as a composite-view asset: it arranges Children with a flexbox Direction and either stacks them (STACK) or shows one at a time (SWITCHER, driven by a navbar).

    CreateFontWindow

    Step-by-step window for turning a source UnityEngine.Font into a persisted, Addressable TMPro.TMP_FontAsset — the atomic counterpart to the Theme Builder's own Font step. FontAssetCreator does the actual validation and generation work. The stepped-wizard scaffolding — the header and breadcrumb, the body scroll, the footer and its error gate, and the select-and-ping a finished run ends with — comes from Serenity.Global.Infrastructure.Editor.SerenityStepWizardWindow`1; this window declares only its own step table and what the primary action does.

    Every run creates a brand-new asset rather than updating one in place — see FontAssetCreator's own "never overwrites" remark — so, like CreateModalWindow, the Done step's own "Create Another" resets the identity fields for a fresh run instead of returning to review the asset just written.

    FontAssetCreator

    Turns a source UnityEngine.Font into a persisted, Addressable TMPro.TMP_FontAsset — the atomic counterpart to the Theme Builder's Font step. The HUD Builder's inline "Generate" button routes through this engine; the Theme Builder keeps calling SerenityFontAssetGenerator directly because its font is one asset inside the theme's own transaction, which registers and rolls back the whole theme at once. Mirrors GameSaveCreator: static class, Input/Result DTOs, ValidateIdentity/Validate/Create, Serenity.Global.Infrastructure.Editor.SerenityAssetCreationTransaction for rollback. Every mutation lives here; SerenityFontAssetGenerator stays the single owner of TMPro's mandatory parent-then-sub-asset write order.

    Never overwrites an existing target: a same-name run only warns, and SerenityFontAssetGenerator uniquifies the path. A generated TMPro.TMP_FontAsset carries no Serenity-owned authoring state to draft and re-commit, and every prefab already referencing it would break on a silent replace, so the "tools are management tools" update-in-place shape does not apply here.

    FontAssetCreator.Input

    Everything needed to build a font asset from a source font.

    FontAssetCreator.Result

    Outcome of a Create(Input) call.

    LeafNode

    A leaf region that hosts a single menu — either a menu the tool generates, or an existing view definition the designer assigned. A leaf flagged IsNavbar is the generated navigation menu whose options (NavTargets) switch a sibling content switcher.

    TemplateBuilder

    Maps a TemplateParams onto a region tree (IRegionNode), assigning ids, sizes, content modes and — for navbar templates — fully-wired navbar targets. Pure and unit-testable; the generator turns the returned tree into assets.

    TemplateParams

    Inputs for Build(TemplateParams).

    UiSettingsCreator

    Generates (or updates) the project-wide UnityUiSettings asset from a single description. Runs on SingletonSettingsCreationEngine<TSettings, TInput, TResult>: this class stays the caller-facing static surface — Input/Result DTOs, ValidateIdentity/Validate/Create, ResolveSettingsContext<TSettings>(string, string) for "edit existing" detection, the EnsureSettings(string, bool, string) headless get-or-create seam — and forwards every member to one UiSettingsCreator.Engine instance that supplies the module's own fields. Lives beside CompositeViewGenerator — rather than beside CreateUiSettingsWindow in Ui Installation's editor assembly — because Serenity.Ui.Infrastructure.Editor.Builder.CompositeViewGenerator.TrySetInitialView(System.String,Serenity.Ui.Infrastructure.Editor.Builder.CompositeViewGenerator.Result,System.String) needs it too, and Ui Installation's editor assembly already depends on Ui Infrastructure's, so the reverse direction would cycle; the window reaches this engine through that same existing dependency. Every asset mutation lives in the engine; the window and the generator both only collect input/react to results.

    UnityUiSettings's font size presets seed through the SO's own field initializer (small/medium/big), and its Prewarm labels/addresses are inspector-only fields with no meaningful value at creation time — neither UiSettingsCreator.Input nor Serenity.Ui.Infrastructure.Editor.Builder.UiSettingsCreator.Engine.ApplyFields(Serenity.Ui.Infrastructure.Editor.Builder.UiSettingsCreator.Input,Serenity.Ui.Installation.Settings.UnityUiSettings) touches either, so a freshly created asset keeps its three presets and an update never disturbs prewarm lists authored outside this wizard.

    UiSettingsCreator.Input

    Everything needed to create or update the settings asset.

    UiSettingsCreator.Result

    Outcome of a Create(Input) or EnsureSettings(string, bool, string) call.

    Structs

    NavTarget

    One wired navigation target on a navbar: the option label and the full composite-path it activates (e.g. "Root::Content::Tab1"), or the Back sentinel.

    Interfaces

    IRegionNode

    Engine-agnostic description of one region in a composite-view screen, produced by TemplateBuilder from a template + parameters and consumed by the generator to create the actual UnityCompositeViewDefinition / menu assets. Kept free of UnityEditor and asset APIs so the template-to-tree mapping is pure and unit-testable.

    Enums

    CompositeTemplate

    The layout templates the Composite View Builder offers.

    CreateFontWindow.WizardStep

    Public rather than private because C# requires a class's base type to be at least as accessible as the class itself, and this enum is that base type's argument.

    NavbarSide

    Where the navbar sits relative to the content (decides the root direction + child order).

    In this article
    © 2026 Serenity. All Rights Reserved