Version: 5.3 (switch to 5.4b)
ЯзыкEnglish
  • C#
  • JS

Язык программирования

Выберите подходящий для вас язык программирования. Все примеры кода будут представлены на выбранном языке.

SceneManager.UnloadScene

Предложить изменения

Успех!

Благодарим вас за то, что вы помогаете нам улучшить качество документации по Unity. Однако, мы не можем принять любой перевод. Мы проверяем каждый предложенный вами вариант перевода и принимаем его только если он соответствует оригиналу.

Закрыть

Ошибка внесения изменений

По определённым причинам предложенный вами перевод не может быть принят. Пожалуйста <a>попробуйте снова</a> через пару минут. И выражаем вам свою благодарность за то, что вы уделяете время, чтобы улучшить документацию по Unity.

Закрыть

Отменить

Руководство
public static function UnloadScene(sceneBuildIndex: int): bool;
public static bool UnloadScene(int sceneBuildIndex);
public static function UnloadScene(sceneName: string): bool;
public static bool UnloadScene(string sceneName);

Параметры

sceneBuildIndex Index of the scene in the Build Settings to unload.
sceneName Name of the scene to unload.
scene Scene to unload.

Возврат значений

bool Returns true if the scene is unloaded.

Описание

Unloads all GameObjects associated with the given scene.

The given sceneName can either be the last part of the path, without .unity extension or the full path still without the .unity extension. The path has to be exactly as shown in the Build Settings Window. 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 path.

Note that this is case insensitive.

Note that assets are currently not unloaded, in order to free up asset memory call Resources.UnloadUnusedAssets.