Version: 5.4

EditorSceneManager

class in UnityEditor.SceneManagement

/

Inherits from:SceneManagement.SceneManager

Switch to Manual

Description

Scene management in the Editor.

Static Variables

loadedSceneCountThe number of loaded Scenes.
preventCrossSceneReferencesControls whether cross-Scene references are allowed in the Editor.

Static Functions

CloseSceneClose the Scene. If removeScene flag is true, the closed Scene will also be removed from EditorSceneManager.
DetectCrossSceneReferencesChecks for cross-Scene references in the specified Scene.
GetSceneManagerSetupReturns the current setup of the SceneManager.
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.
NewSceneСоздает новую сцену.
OpenSceneOpen a Scene in the Editor.
RestoreSceneManagerSetupRestore the setup of the SceneManager.
SaveCurrentModifiedScenesIfUserWantsToAsk the user if they want to save the the modified Scene(s).
SaveModifiedScenesIfUserWantsToAsk the user if they want to save any of the modfied input Scenes.
SaveOpenScenesСоздает новую сцену.
SaveSceneСоздает новую сцену.
SaveScenesSave a list of Scenes.

Inherited members

Static Variables

sceneCountThe total number of currently loaded scenes.
sceneCountInBuildSettingsNumber of scenes in Build Settings.

Static Functions

CreateSceneCreate an empty new scene at runtime with the given name.
GetActiveSceneGets the currently active scene.
GetSceneAtGet the scene at index in the SceneManager's list of added scenes.
GetSceneByNameSearches through the scenes added to the SceneManager for a scene with the given name.
GetSceneByPathSearches all scenes added to the SceneManager for a scene that has the given asset path.
LoadSceneLoads the scene by its name or index in Build Settings.
LoadSceneAsyncLoads the scene asynchronously in the background.
MergeScenesThis will merge the source scene into the destinationScene. This function merges the contents of the source scene into the destination scene, and deletes the source scene. All GameObjects at the root of the source scene are moved to the root of the destination scene. NOTE: This function is destructive: The source scene will be destroyed once the merge has been completed.
MoveGameObjectToSceneMove a GameObject from its current scene to a new Scene. You can only move root GameObjects from one Scene to another. This means the GameObject to move must not be a child of any other GameObject in its Scene.
SetActiveSceneSet the scene to be active.
UnloadSceneDestroyes all GameObjects associated with the given scene and removes the scene from the SceneManager.

Events

SceneManagement.SceneManagerAdd a delegate to this to get notifications when a scene has loaded
SceneManagement.SceneManagerAdd a delegate to this to get notifications when a scene has unloaded
SceneManagement.SceneManagerAdd a delegate to this to get notifications when the active scene has changed
activeSceneChangedAdd a delegate to this to get notifications when the active scene has changed
sceneLoadedAdd a delegate to this to get notifications when a scene has loaded
sceneUnloadedAdd a delegate to this to get notifications when a scene has unloaded