Show / Hide Table of Contents

Class SceneManager

Inheritance
Object
SceneManager
EditorSceneManager
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: UnityEngine.SceneManagement
Assembly: UnityEngine.dll
Syntax
public class SceneManager

Properties

sceneCount

Declaration
public static int sceneCount { get; }
Property Value
Type Description
Int32

sceneCountInBuildSettings

Declaration
public static int sceneCountInBuildSettings { get; }
Property Value
Type Description
Int32

Methods

| Improve this Doc View Source

CreateScene(String)

Declaration
public static Scene CreateScene(string sceneName)
Parameters
Type Name Description
String sceneName
Returns
Type Description
Scene

CreateScene(String, CreateSceneParameters)

Declaration
public static Scene CreateScene(string sceneName, CreateSceneParameters parameters)
Parameters
Type Name Description
String sceneName
CreateSceneParameters parameters
Returns
Type Description
Scene

GetActiveScene()

Declaration
public static Scene GetActiveScene()
Returns
Type Description
Scene
| Improve this Doc View Source

GetAllScenes()

Declaration
[Obsolete("Use SceneManager.sceneCount and SceneManager.GetSceneAt(int index) to loop the all scenes instead.")]
public static Scene[] GetAllScenes()
Returns
Type Description
Scene[]

GetSceneAt(Int32)

Declaration
public static Scene GetSceneAt(int index)
Parameters
Type Name Description
Int32 index
Returns
Type Description
Scene

GetSceneByBuildIndex(Int32)

Declaration
public static Scene GetSceneByBuildIndex(int buildIndex)
Parameters
Type Name Description
Int32 buildIndex
Returns
Type Description
Scene

GetSceneByName(String)

Declaration
public static Scene GetSceneByName(string name)
Parameters
Type Name Description
String name
Returns
Type Description
Scene

GetSceneByPath(String)

Declaration
public static Scene GetSceneByPath(string scenePath)
Parameters
Type Name Description
String scenePath
Returns
Type Description
Scene
| Improve this Doc View Source

LoadScene(Int32)

Declaration
[ExcludeFromDocs]
public static void LoadScene(int sceneBuildIndex)
Parameters
Type Name Description
Int32 sceneBuildIndex
| Improve this Doc View Source

LoadScene(Int32, LoadSceneMode)

Declaration
public static void LoadScene(int sceneBuildIndex, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
Parameters
Type Name Description
Int32 sceneBuildIndex
LoadSceneMode mode
| Improve this Doc View Source

LoadScene(Int32, LoadSceneParameters)

Declaration
public static Scene LoadScene(int sceneBuildIndex, LoadSceneParameters parameters)
Parameters
Type Name Description
Int32 sceneBuildIndex
LoadSceneParameters parameters
Returns
Type Description
Scene
| Improve this Doc View Source

LoadScene(String)

Declaration
[ExcludeFromDocs]
public static void LoadScene(string sceneName)
Parameters
Type Name Description
String sceneName
| Improve this Doc View Source

LoadScene(String, LoadSceneMode)

Declaration
public static void LoadScene(string sceneName, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
Parameters
Type Name Description
String sceneName
LoadSceneMode mode
| Improve this Doc View Source

LoadScene(String, LoadSceneParameters)

Declaration
public static Scene LoadScene(string sceneName, LoadSceneParameters parameters)
Parameters
Type Name Description
String sceneName
LoadSceneParameters parameters
Returns
Type Description
Scene
| Improve this Doc View Source

LoadSceneAsync(Int32)

Declaration
[ExcludeFromDocs]
public static AsyncOperation LoadSceneAsync(int sceneBuildIndex)
Parameters
Type Name Description
Int32 sceneBuildIndex
Returns
Type Description
AsyncOperation
| Improve this Doc View Source

LoadSceneAsync(Int32, LoadSceneMode)

Declaration
public static AsyncOperation LoadSceneAsync(int sceneBuildIndex, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
Parameters
Type Name Description
Int32 sceneBuildIndex
LoadSceneMode mode
Returns
Type Description
AsyncOperation
| Improve this Doc View Source

LoadSceneAsync(Int32, LoadSceneParameters)

Declaration
public static AsyncOperation LoadSceneAsync(int sceneBuildIndex, LoadSceneParameters parameters)
Parameters
Type Name Description
Int32 sceneBuildIndex
LoadSceneParameters parameters
Returns
Type Description
AsyncOperation
| Improve this Doc View Source

LoadSceneAsync(String)

Declaration
[ExcludeFromDocs]
public static AsyncOperation LoadSceneAsync(string sceneName)
Parameters
Type Name Description
String sceneName
Returns
Type Description
AsyncOperation
| Improve this Doc View Source

LoadSceneAsync(String, LoadSceneMode)

Declaration
public static AsyncOperation LoadSceneAsync(string sceneName, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
Parameters
Type Name Description
String sceneName
LoadSceneMode mode
Returns
Type Description
AsyncOperation
| Improve this Doc View Source

LoadSceneAsync(String, LoadSceneParameters)

Declaration
public static AsyncOperation LoadSceneAsync(string sceneName, LoadSceneParameters parameters)
Parameters
Type Name Description
String sceneName
LoadSceneParameters parameters
Returns
Type Description
AsyncOperation

MergeScenes(Scene, Scene)

Declaration
public static void MergeScenes(Scene sourceScene, Scene destinationScene)
Parameters
Type Name Description
Scene sourceScene
Scene destinationScene

MoveGameObjectToScene(GameObject, Scene)

Declaration
public static void MoveGameObjectToScene(GameObject go, Scene scene)
Parameters
Type Name Description
GameObject go
Scene scene

SetActiveScene(Scene)

Declaration
public static bool SetActiveScene(Scene scene)
Parameters
Type Name Description
Scene scene
Returns
Type Description
Boolean
| Improve this Doc View Source

UnloadScene(Int32)

Declaration
[Obsolete("Use SceneManager.UnloadSceneAsync. This function is not safe to use during triggers and under other circumstances. See Scripting reference for more details.")]
public static bool UnloadScene(int sceneBuildIndex)
Parameters
Type Name Description
Int32 sceneBuildIndex
Returns
Type Description
Boolean
| Improve this Doc View Source

UnloadScene(String)

Declaration
[Obsolete("Use SceneManager.UnloadSceneAsync. This function is not safe to use during triggers and under other circumstances. See Scripting reference for more details.")]
public static bool UnloadScene(string sceneName)
Parameters
Type Name Description
String sceneName
Returns
Type Description
Boolean
| Improve this Doc View Source

UnloadScene(Scene)

Declaration
[Obsolete("Use SceneManager.UnloadSceneAsync. This function is not safe to use during triggers and under other circumstances. See Scripting reference for more details.")]
public static bool UnloadScene(Scene scene)
Parameters
Type Name Description
Scene scene
Returns
Type Description
Boolean
| Improve this Doc View Source

UnloadSceneAsync(Int32)

Declaration
public static AsyncOperation UnloadSceneAsync(int sceneBuildIndex)
Parameters
Type Name Description
Int32 sceneBuildIndex
Returns
Type Description
AsyncOperation
| Improve this Doc View Source

UnloadSceneAsync(String)

Declaration
public static AsyncOperation UnloadSceneAsync(string sceneName)
Parameters
Type Name Description
String sceneName
Returns
Type Description
AsyncOperation
| Improve this Doc View Source

UnloadSceneAsync(Scene)

Declaration
public static AsyncOperation UnloadSceneAsync(Scene scene)
Parameters
Type Name Description
Scene scene
Returns
Type Description
AsyncOperation

Events

| Improve this Doc View Source

activeSceneChanged

Declaration
public static event UnityAction<Scene, Scene> activeSceneChanged
Event Type
Type Description
UnityAction<Scene, Scene>
| Improve this Doc View Source

sceneLoaded

Declaration
public static event UnityAction<Scene, LoadSceneMode> sceneLoaded
Event Type
Type Description
UnityAction<Scene, LoadSceneMode>
| Improve this Doc View Source

sceneUnloaded

Declaration
public static event UnityAction<Scene> sceneUnloaded
Event Type
Type Description
UnityAction<Scene>

Extension Methods

MustExtensions.MustBeEqual<T>(T, T)
MustExtensions.MustBeEqual<T>(T, T, String)
MustExtensions.MustNotBeEqual<T>(T, T)
MustExtensions.MustNotBeEqual<T>(T, T, String)
MustExtensions.MustBeNull<T>(T)
MustExtensions.MustBeNull<T>(T, String)
MustExtensions.MustNotBeNull<T>(T)
MustExtensions.MustNotBeNull<T>(T, String)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX