Format
typescript
SceneManager.UnloadScene(scene)class: SceneManager
Description
Unload the target scene.
After unloading the scene, all game objects, resources, 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 |
|---|---|---|
| scene | Scene | The target scene |
Return
| type | description |
|---|---|
boolean | Whether the unload is successful |
Code Example
typescript
const scene = SceneManager.CreateScene("test");
SceneManager.UnloadScene(scene)