logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class SerenityCreateGameSceneGenerator

    Orchestrates a full Create Game run: the gameplay scene, the boot scene, and the installer wiring that links them together, under a single output root. Mirrors SerenitySampleSceneGenerator: a static class, a SerenityCreateGameSceneGenerator.Result DTO, created-paths rollback via Serenity.Global.Infrastructure.Editor.SerenityAssetCreationTransaction, and no dialogs — this is the testable API a future menu-item wrapper calls.

    The boot scene's InitializationScene field must point at the boot scene itself, which does not exist as a UnityEditor.SceneAsset until after its first save. This runs the boot scene in two passes: the first save leaves InitializationScene null (only its string-typed sibling InitializationScenePath is known ahead of time, since that one is just a path, not an object reference). Once the save gives the scene a resolvable UnityEditor.SceneAsset, a second wiring pass sets the reference on the still-loaded scene and re-saves it — cheaper than closing and reopening the scene, since UnityEditor.SceneManagement.EditorSceneManager.SaveScene(UnityEngine.SceneManagement.Scene,System.String,System.Boolean) does not unload it.

    Inheritance
    object
    SerenityCreateGameSceneGenerator
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.CreateGame.Infrastructure.Editor
    Assembly: Serenity.UnityCreateGame.Infrastructure.Editor.dll
    Syntax
    public static class SerenityCreateGameSceneGenerator

    Methods

    Generate(string, CreateGameGeneratedAssets)

    Builds the gameplay scene, then the boot scene wired onto it (and onto itself, and onto generatedAssets), under rootFolder. Idempotent: rerunning overwrites both scenes in place — Result.CreatedPaths only lists paths that did not already exist before this call. On any failure, every asset this call created is rolled back and the project is left untouched.

    Declaration
    public static SerenityCreateGameSceneGenerator.Result Generate(string rootFolder, CreateGameGeneratedAssets generatedAssets)
    Parameters
    Type Name Description
    string rootFolder

    Output folder both scenes are saved directly under. Tests pass a disposable temp folder here instead of Serenity.CreateGame.Infrastructure.Editor.CreateGameScenePaths.DefaultRootFolder.

    CreateGameGeneratedAssets generatedAssets

    The wizard-generated settings asset paths to wire onto the installer.

    Returns
    Type Description
    SerenityCreateGameSceneGenerator.Result
    In this article
    © 2026 Serenity. All Rights Reserved