EditorSceneManager
Scene management in the Editor.
Read time 6 minutesLast updated 10 days ago
Definition
- Type: Class
- Namespace: UnityEditor.SceneManagement
- Assembly: UnityEditor
- Inherits from: SceneManager
public sealed class EditorSceneManager : SceneManager
Static Fields
Value | Description |
|---|---|
| DefaultSceneCullingMask | Use SceneCullingMasks.DefaultSceneCullingMask instead. |
Static Properties
Property | Description |
|---|---|
| playModeStartScene | Loads this SceneAsset when you start Play Mode. |
| preventCrossSceneReferences | Controls whether cross-Scene references are allowed in the Editor. |
| previewSceneCount | The current amount of active preview Scenes. |
Static Methods
Method | Description |
|---|---|
| CalculateAvailableSceneCullingMask | Go through all Scenes and find the smallest unused bit in the unition of all Scene culling masks. |
| ClosePreviewScene | Closes a preview Scene created by EditorSceneManager.NewPreviewScene or EditorSceneManager.OpenPreviewScene. |
| CloseScene | Close the Scene. If removeScene flag is true, the closed Scene will also be removed from EditorSceneManager. |
| DetectCrossSceneReferences | Detects cross-Scene references in a Scene. |
| EnsureUntitledSceneHasBeenSaved | Shows a save dialog if an Untitled Scene exists in the current Scene manager setup. |
| GetSceneCullingMask | Return the culling mask set on the given Scene. |
| GetSceneManagerSetup | Returns the current setup of the SceneManager. |
| IsPreviewScene | Is the Scene a preview Scene? |
| IsPreviewSceneObject | Is this object part of a preview Scene? |
| LoadSceneAsyncInPlayMode | This 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. |
| LoadSceneInPlayMode | This 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. |
| MarkAllScenesDirty | Mark all the loaded Scenes as modified. |
| MarkSceneDirty | Mark the specified Scene as modified. |
| MoveSceneAfter | Allows you to reorder the Scenes currently open in the Hierarchy window. Moves the source Scene so it comes after the destination Scene. |
| MoveSceneBefore | Allows you to reorder the Scenes currently open in the Hierarchy window. Moves the source Scene so it comes before the destination Scene. |
| NewPreviewScene | Creates a new preview Scene. Any object added to a preview Scene will only be rendered in that Scene. |
| NewScene | Create a new Scene. |
| OpenPreviewScene | Opens a Scene Asset in a preview Scene. |
| OpenScene | Open a Scene in the Editor. |
| RestoreSceneManagerSetup | Restore the setup of the SceneManager. |
| SaveCurrentModifiedScenesIfUserWantsTo | Asks the user if they want to save the current open modified Scene or Scenes in the Hierarchy. |
| SaveModifiedScenesIfUserWantsTo | Asks whether the modfied input Scenes should be saved. |
| SaveOpenScenes | Save all open Scenes. |
| SaveScene | Save a Scene. |
| SaveScenes | Save a list of Scenes. |
| SetSceneCullingMask | Set 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 |
|---|---|
| activeSceneChangedInEditMode | Subscribe to this event to get notified when the active Scene has changed in Edit mode in the Editor. |
| newSceneCreated | This event is called after a new Scene has been created. |
| sceneClosed | This event is called after a Scene has been closed in the editor. |
| sceneClosing | This event is called before closing an open Scene after you have requested that the Scene is closed. |
| sceneDirtied | This event is called after a Scene has been modified in the editor. |
| sceneManagerSetupRestored | This can be useful to get notified when the SceneManager's scenes are replaced with a set of new scenes from calls to . |
| sceneOpened | This event is called after a Scene has been opened in the editor. |
| sceneOpening | This event is called before opening an existing Scene. |
| sceneSaved | This event is called after a Scene has been saved. |
| sceneSaving | This event is called before a Scene is saved disk after you have requested the Scene to be saved. |
Delegates
Delegate | Description |
|---|---|
| EditorSceneManager.NewSceneCreatedCallback | Callbacks of this type which have been added to the EditorSceneManager.newSceneCreated event are called after a new Scene has been created. |
| EditorSceneManager.SceneClosedCallback | Callbacks of this type which have been added to the EditorSceneManager.sceneClosed event are called immediately after the Scene has been closed. |
| EditorSceneManager.SceneClosingCallback | Callbacks of this type which have been added to the EditorSceneManager.sceneClosing event are called just before a Scene is closed. |
| EditorSceneManager.SceneDirtiedCallback | Callbacks 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.SceneManagerSetupRestoredCallback | Callbacks of this type which have been added to the EditorSceneManager.sceneManagerSetupRestored event are called after EditorSceneManager.RestoreSceneManagerSetup has been called. |
| EditorSceneManager.SceneOpenedCallback | Callbacks of this type which have been added to the EditorSceneManager.sceneOpened event are called after a Scene has been opened. |
| EditorSceneManager.SceneOpeningCallback | Callbacks of this type which have been added to the EditorSceneManager.sceneOpening event are called just before opening a Scene. |
| EditorSceneManager.SceneSavedCallback | Callbacks of this type which have been added to the EditorSceneManager.sceneSaved event are called after a Scene has been saved. |
| EditorSceneManager.SceneSavingCallback | Callbacks of this type which have been added to the EditorSceneManager.sceneSaving event are called just before the Scene is saved. |