Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


EditorSceneManager

Scene management in the Editor.
Read time 6 minutesLast updated 10 days ago

Definition

public sealed class EditorSceneManager : SceneManager

Static Fields

Static Properties

Property

Description

playModeStartSceneLoads this SceneAsset when you start Play Mode.
preventCrossSceneReferencesControls whether cross-Scene references are allowed in the Editor.
previewSceneCountThe current amount of active preview Scenes.

Static Methods

Method

Description

CalculateAvailableSceneCullingMaskGo through all Scenes and find the smallest unused bit in the unition of all Scene culling masks.
ClosePreviewSceneCloses a preview Scene created by EditorSceneManager.NewPreviewScene or EditorSceneManager.OpenPreviewScene.
CloseSceneClose the Scene. If removeScene flag is true, the closed Scene will also be removed from EditorSceneManager.
DetectCrossSceneReferencesDetects cross-Scene references in a Scene.
EnsureUntitledSceneHasBeenSavedShows a save dialog if an Untitled Scene exists in the current Scene manager setup.
GetSceneCullingMaskReturn the culling mask set on the given Scene.
GetSceneManagerSetupReturns the current setup of the SceneManager.
IsPreviewSceneIs the Scene a preview Scene?
IsPreviewSceneObjectIs this object part of a preview Scene?
LoadSceneAsyncInPlayModeThis method allows you to load a Scene during playmode in the editor, without requiring the Scene to be included in the Build Settings Scene list.
LoadSceneInPlayModeThis method allows you to load a Scene during playmode in the editor, without requiring the Scene to be included in the Build Settings Scene list.
MarkAllScenesDirtyMark all the loaded Scenes as modified.
MarkSceneDirtyMark the specified Scene as modified.
MoveSceneAfterAllows you to reorder the Scenes currently open in the Hierarchy window. Moves the source Scene so it comes after the destination Scene.
MoveSceneBeforeAllows you to reorder the Scenes currently open in the Hierarchy window. Moves the source Scene so it comes before the destination Scene.
NewPreviewSceneCreates a new preview Scene. Any object added to a preview Scene will only be rendered in that Scene.
NewSceneCreate a new Scene.
OpenPreviewSceneOpens a Scene Asset in a preview Scene.
OpenSceneOpen a Scene in the Editor.
RestoreSceneManagerSetupRestore the setup of the SceneManager.
SaveCurrentModifiedScenesIfUserWantsToAsks the user if they want to save the current open modified Scene or Scenes in the Hierarchy.
SaveModifiedScenesIfUserWantsToAsks whether the modfied input Scenes should be saved.
SaveOpenScenesSave all open Scenes.
SaveSceneSave a Scene.
SaveScenesSave a list of Scenes.
SetSceneCullingMaskSet the culling mask on this scene to this value. Cameras will only render objects in Scenes that have the same bits set in their culling mask.

Static Events

Member

Description

activeSceneChangedInEditModeSubscribe to this event to get notified when the active Scene has changed in Edit mode in the Editor.
newSceneCreatedThis event is called after a new Scene has been created.
sceneClosedThis event is called after a Scene has been closed in the editor.
sceneClosingThis event is called before closing an open Scene after you have requested that the Scene is closed.
sceneDirtiedThis event is called after a Scene has been modified in the editor.
sceneManagerSetupRestoredThis can be useful to get notified when the SceneManager's scenes are replaced with a set of new scenes from calls to .
sceneOpenedThis event is called after a Scene has been opened in the editor.
sceneOpeningThis event is called before opening an existing Scene.
sceneSavedThis event is called after a Scene has been saved.
sceneSavingThis event is called before a Scene is saved disk after you have requested the Scene to be saved.

Delegates

Delegate

Description

EditorSceneManager.NewSceneCreatedCallbackCallbacks of this type which have been added to the EditorSceneManager.newSceneCreated event are called after a new Scene has been created.
EditorSceneManager.SceneClosedCallbackCallbacks of this type which have been added to the EditorSceneManager.sceneClosed event are called immediately after the Scene has been closed.
EditorSceneManager.SceneClosingCallbackCallbacks of this type which have been added to the EditorSceneManager.sceneClosing event are called just before a Scene is closed.
EditorSceneManager.SceneDirtiedCallbackCallbacks of this type which have been added to the EditorSceneManager.sceneDirtied event are called after a Scene changes from being unmodified to being modified.
EditorSceneManager.SceneManagerSetupRestoredCallbackCallbacks of this type which have been added to the EditorSceneManager.sceneManagerSetupRestored event are called after EditorSceneManager.RestoreSceneManagerSetup has been called.
EditorSceneManager.SceneOpenedCallbackCallbacks of this type which have been added to the EditorSceneManager.sceneOpened event are called after a Scene has been opened.
EditorSceneManager.SceneOpeningCallbackCallbacks of this type which have been added to the EditorSceneManager.sceneOpening event are called just before opening a Scene.
EditorSceneManager.SceneSavedCallbackCallbacks of this type which have been added to the EditorSceneManager.sceneSaved event are called after a Scene has been saved.
EditorSceneManager.SceneSavingCallbackCallbacks of this type which have been added to the EditorSceneManager.sceneSaving event are called just before the Scene is saved.

Inheritance