logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.Stage.Infrastructure.Interfaces

    Interfaces

    IUnityStageRuntime

    Unity-layer intention interface for the hybrid stage runtime. Exposes Unity-specific operations that are NOT on IStageService (prefab instantiation, spawn resolver, wave set, rail path building). Allows the composition root to wire stage↔wave without casting to concrete types.

    IUnityStageRuntimeAsync

    Optional capability on top of IUnityStageRuntime: builds a stage prefab off the main thread's critical path so the cost lands across several frames instead of one, then swaps it in when the game is ready for it.

    Instantiating a whole level is the single most expensive thing a game does outside loading, and doing it synchronously shows up as a dropped frame wherever it happens. Splitting it into prepare-then-commit lets a caller start the build while a results screen, cutscene, or loading overlay is up, and commit only once the build has actually finished.

    In this article
    © 2026 Serenity. All Rights Reserved