Skip to content

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_nametypedescription
sceneSceneThe target scene

Return

typedescription
booleanWhether the unload is successful

Code Example

typescript
 const scene = SceneManager.CreateScene("test");    
 SceneManager.UnloadScene(scene)