Closes all opened scene (async).
()
| 321 | /// Closes all opened scene (async). |
| 322 | /// </summary> |
| 323 | public void CloseAllScenes() |
| 324 | { |
| 325 | if (!Editor.StateMachine.CurrentState.CanChangeScene) |
| 326 | return; |
| 327 | |
| 328 | // In play-mode Editor mocks the level streaming script |
| 329 | if (Editor.IsPlayMode) |
| 330 | { |
| 331 | Level.UnloadAllScenesAsync(); |
| 332 | return; |
| 333 | } |
| 334 | |
| 335 | // Ensure to save all pending changes |
| 336 | if (CheckSaveBeforeClose()) |
| 337 | return; |
| 338 | |
| 339 | // Unload scenes |
| 340 | Editor.StateMachine.ChangingScenesState.UnloadScene(Level.Scenes); |
| 341 | } |
| 342 | |
| 343 | /// <summary> |
| 344 | /// Closes all of the scenes except for the specified scene (async). |
no test coverage detected