Format
typescript
SceneManager.UnloadSceneByName(name)class: SceneManager
Description
Unloads the scene with the specified name.
After unloading the scene, all game objects, assets, and scripts in the scene will be released, and the scene will be unloaded from memory, freeing up related resources.
Parameters
| param_name | type | description |
|---|---|---|
| name | String | The name of the scene. |
Return
| type | description |
|---|---|
boolean | Returns true if the scene is successfully unloaded. |
Code Example
typescript
const scene = SceneManager.CreateScene("test");
SceneManager.UnloadScene("test")