Version: 5.6
public static AsyncOperation UnloadSceneAsync (int sceneBuildIndex);
public static AsyncOperation UnloadSceneAsync (string sceneName);
public static AsyncOperation UnloadSceneAsync (SceneManagement.Scene scene);

パラメーター

sceneBuildIndex BuildSetting の シーンのインデックス
sceneName 解放するシーンの名前、またはパス
scene 解放するシーン

戻り値

AsyncOperation 操作が終了したかを判別するには、AsyncOperation を使用します。

説明

Destroys all GameObjects associated with the given scene and removes the scene from the SceneManager.

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"

これは、大文字小文字の違いを区別しません。また、非同期のため、終了時間に関して保証がないということに注意してください。

現在解放されていないアセットに注意してください。アセットメモリを開放するために Resources.UnloadAllUnusedAssets を呼び出してください。