Closes scene (async). The scene.
(Scene scene)
| 298 | /// </summary> |
| 299 | /// <param name="scene">The scene.</param> |
| 300 | public void CloseScene(Scene scene) |
| 301 | { |
| 302 | if (!Editor.StateMachine.CurrentState.CanChangeScene) |
| 303 | return; |
| 304 | |
| 305 | // In play-mode Editor mocks the level streaming script |
| 306 | if (Editor.IsPlayMode) |
| 307 | { |
| 308 | Level.UnloadSceneAsync(scene); |
| 309 | return; |
| 310 | } |
| 311 | |
| 312 | // Ensure to save all pending changes |
| 313 | if (CheckSaveBeforeClose()) |
| 314 | return; |
| 315 | |
| 316 | // Unload scene |
| 317 | Editor.StateMachine.ChangingScenesState.UnloadScene(scene); |
| 318 | } |
| 319 | |
| 320 | /// <summary> |
| 321 | /// Closes all opened scene (async). |
no test coverage detected