logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.SampleScene.Infrastructure.Editor

    Classes

    SerenitySampleSceneGenerator

    Generates the demo scene Assets/Documentation/SAMPLE_SCENE_GUIDE.md walks a designer through by hand: a Canvas/EventSystem, the Diagnostics Overlay, a reusable Toast prefab, and a button that shows it directly. The guide's signal-emitter/reaction chain is intentionally not generated — it depends on IEventDispatcherService, which only the boot pipeline registers, so it would silently do nothing in this standalone scene (see section 5 of the guide for adding it by hand in a booted project).

    Hand-authoring the resulting .unity/.prefab YAML is unreviewable and unmaintainable, so this is a deterministic C# generator instead: a human runs it once via the menu item below, and its output is reproducible and unit-testable (see Generate(string), which every test drives directly against a disposable output folder instead of the shipped one).

    Mirrors ThemeCreator/SignalDefinitionCreator: a static class, a SerenitySampleSceneGenerator.Result DTO, created-paths rollback on failure, and Addressables registration only after the whole run succeeds.

    SerenitySampleSceneGenerator.Result

    Outcome of a Generate(string) call. The inherited Serenity.Global.Infrastructure.Editor.SerenityCreationResult.CreatedPaths covers folders and the toast prefab, and is empty on a rerun that only updated already-existing assets in place.

    In this article
    © 2026 Serenity. All Rights Reserved