Version: 5.4
public static bool UnloadScene (int sceneBuildIndex);
public static bool UnloadScene (string sceneName);
public static bool UnloadScene (SceneManagement.Scene scene);

Parámetros

sceneBuildIndex Indice de la escena en los Build Settings para descargar.
sceneName Nombre o ruta de la escena a des-cargar.
scene Escena ha descargar.

Valor de retorno

bool Devuelve true si la escena se descarga.

Descripción

Destruye todos los GameObjects asociados con la escena dada y quita la escena del SceneManager.

Warning: Esto no se puede llamar durante varios callbacks de física y de visibilidad como OnTriggerEnter o OnBecameVisible.

The given scene name can either be the full scene path, the path shown in the Build Settings window or just the scene name. If only the scene name is given this will load the first scene in the list that matches. If you have multiple scenes with same name but different paths, you should use the full scene path. Examples of supported formats: "Assets/Scenes/Scene1.unity" "Scenes/Scene1" "Scene1"

Tenga en cuenta que sceneName es sensible a las mayúsculas.

Tenga en cuenta que los assets actualmente no están des-cargados, con el fin de librar memoria asset llame Resources.UnloadAllUnusedAssets.