Manages scene loading, transitions and lifecycle.
Provides methods to register scenes, load scenes by name, and handles the opening scene.
Ensures proper cleanup between scene transitions and maintains scene state.

this.sceneManager.loadScene("MainScene");

Accessors

  • get sceneLoadedThisFrame(): boolean
  • Returns true if the scene was loaded this frame

    Returns boolean

Methods

  • Adds a scene to the SceneManager

    Parameters

    • sceneType: SceneType<Scene>

      The scene class

    • name: string

      The name of the scene

    • openingScene: boolean = false

      Whether the scene is the opening scene

    Returns void

  • Loads a scene

    Parameters

    • name: string

      The name of the scene

    • OptionalpreserveEntitiesWithComponent: ComponentType

      Optional component type to preserve entities that have this component

    Returns void