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

Method CloseScene

Source/Editor/Modules/SceneModule.cs:300–318  ·  view source on GitHub ↗

Closes scene (async). The scene.

(Scene scene)

Source from the content-addressed store, hash-verified

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

Callers 1

OnUnloadMethod · 0.80

Calls 2

UnloadSceneAsyncMethod · 0.80
UnloadSceneMethod · 0.45

Tested by

no test coverage detected