Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


UnloadLevel

Unloads all GameObject associated with the given Scene. Assets are currently not unloaded to free up asset memory call Resources.UnloadAllUnusedAssets.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

UnloadLevel(int)

Unloads all GameObject associated with the given Scene. Assets are currently not unloaded to free up asset memory call
Resources.UnloadAllUnusedAssets
.
Warning
Deprecated. Use SceneManager.UnloadScene
public static bool UnloadLevel(int index)

Parameters

index

Index of the Scene in the PlayerSettings to unload.

Returns

Type

Description

boolReturns true, if the Scene is unloaded.

UnloadLevel(string)

Unloads all GameObject associated with the given Scene. Assets are currently not unloaded to free up asset memory call
Resources.UnloadAllUnusedAssets
.
Warning
Deprecated. Use SceneManager.UnloadScene
public static bool UnloadLevel(string scenePath)

Parameters

scenePath

Name of the Scene to Unload.

Returns

Type

Description

boolReturns true, if the Scene is unloaded.