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 を呼び出してください。

Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961