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).
- Source
Methods
(static) GetScene(id) → {Scene}
Get a scene by id.
Parameters:
Name | Type | Description |
---|---|---|
id | number | Id of the scene. |
- Source
Returns:
The scene with the specified id.
- Type:
- Scene
(static) GetSceneByName(name) → {Scene}
Get a scene by name.
Parameters:
Name | Type | Description |
---|---|---|
name | string | Name of the scene. |
- Source
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:
Name | Type | Description |
---|---|---|
id | number | Id of the scene to be loaded. |
- Source
(static) LoadSceneAdditive(id)
Load a new scene in additive mode. This will not unload the current scene.
Parameters:
Name | Type | Description |
---|---|---|
id | number | Id of the scene to be loaded. |
- Source
(static) UnloadAllAdditiveScenes()
Unload all added scenes. This will not unload the current scene.
- Source