public static UnloadSceneAsync ( string sceneName ) : |
||
sceneName | string | Name or path of the scene to unload. |
Результат |
public static AsyncOperation UnloadSceneAsync(string sceneName)
{
bool flag;
return UnloadSceneNameIndexInternal(sceneName, -1, false, out flag);
}
SceneManager::UnloadSceneAsync ( |
|
SceneManager::UnloadSceneAsync ( int sceneBuildIndex ) : |
IEnumerator LoadSceneGame(int weight) { Scene scene = SceneManager.GetSceneByName("Game"); if (scene.isLoaded) { _asyncOperation = SceneManager.UnloadSceneAsync(scene); while (!_asyncOperation.isDone) { yield return(0); } } _asyncOperation = SceneManager.LoadSceneAsync("Game", LoadSceneMode.Additive); _asyncOperation.allowSceneActivation = false; yield return(0); float progress = 0; while (!_asyncOperation.isDone) { progress = _asyncOperation.progress < 0.9f ? _asyncOperation.progress : 1; yield return(progress * weight); if (progress >= 0.9f) { _asyncOperation.allowSceneActivation = true; } } }