public static UnloadSceneAsync ( int sceneBuildIndex ) : |
||
sceneBuildIndex | int | Index of the scene in BuildSettings. |
return |
public static AsyncOperation UnloadSceneAsync(int sceneBuildIndex)
{
bool flag;
return UnloadSceneNameIndexInternal("", sceneBuildIndex, false, out flag);
}
SceneManager::UnloadSceneAsync ( |
|
SceneManager::UnloadSceneAsync ( string sceneName ) : |
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; } } }