SceneManager

new SceneManager()

SceneManager is used to load and unload scenes. All scenes will automatically be added to SceneManager. Only the first scene will be loaded by default. To load a scene, use SceneManager.LoadScene(sceneId).

Methods

(static) GetScene(id) → {Scene}

Get a scene by id.

Parameters:
NameTypeDescription
idnumber

Id of the scene.

Returns:

The scene with the specified id.

Type: 
Scene

(static) GetSceneByName(name) → {Scene}

Get a scene by name.

Parameters:
NameTypeDescription
namestring

Name of the scene.

Returns:

The scene with the specified name.

Type: 
Scene

(static) LoadScene(id)

Load a scene by id. This will unload the current scene and load the new scene.

Parameters:
NameTypeDescription
idnumber

Id of the scene to be loaded.

(static) LoadSceneAdditive(id)

Load a new scene in additive mode. This will not unload the current scene.

Parameters:
NameTypeDescription
idnumber

Id of the scene to be loaded.

(static) UnloadAllAdditiveScenes()

Unload all added scenes. This will not unload the current scene.