MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / CloseAllScenes

Method CloseAllScenes

Source/Editor/Modules/SceneModule.cs:323–341  ·  view source on GitHub ↗

Closes all opened scene (async).

()

Source from the content-addressed store, hash-verified

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).

Callers 1

Calls 2

UnloadAllScenesAsyncMethod · 0.80
UnloadSceneMethod · 0.45

Tested by

no test coverage detected