Class SceneManager
Assembly: UnityEngine.dll
Syntax
public class SceneManager
Properties
sceneCount
Declaration
public static int sceneCount { get; }
Property Value
sceneCountInBuildSettings
Declaration
public static int sceneCountInBuildSettings { get; }
Property Value
Methods
|
Improve this Doc
View Source
CreateScene(String)
Declaration
public static Scene CreateScene(string sceneName)
Parameters
Type |
Name |
Description |
String |
sceneName |
|
Returns
CreateScene(String, CreateSceneParameters)
Declaration
public static Scene CreateScene(string sceneName, CreateSceneParameters parameters)
Parameters
Returns
GetActiveScene()
Declaration
public static Scene GetActiveScene()
Returns
|
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
GetSceneAt(Int32)
Declaration
public static Scene GetSceneAt(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Returns
GetSceneByBuildIndex(Int32)
Declaration
public static Scene GetSceneByBuildIndex(int buildIndex)
Parameters
Type |
Name |
Description |
Int32 |
buildIndex |
|
Returns
GetSceneByName(String)
Declaration
public static Scene GetSceneByName(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
GetSceneByPath(String)
Declaration
public static Scene GetSceneByPath(string scenePath)
Parameters
Type |
Name |
Description |
String |
scenePath |
|
Returns
|
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
|
Improve this Doc
View Source
LoadScene(Int32, LoadSceneParameters)
Declaration
public static Scene LoadScene(int sceneBuildIndex, LoadSceneParameters parameters)
Parameters
Returns
|
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
|
Improve this Doc
View Source
LoadScene(String, LoadSceneParameters)
Declaration
public static Scene LoadScene(string sceneName, LoadSceneParameters parameters)
Parameters
Returns
|
Improve this Doc
View Source
LoadSceneAsync(Int32)
Declaration
[ExcludeFromDocs]
public static AsyncOperation LoadSceneAsync(int sceneBuildIndex)
Parameters
Type |
Name |
Description |
Int32 |
sceneBuildIndex |
|
Returns
|
Improve this Doc
View Source
LoadSceneAsync(Int32, LoadSceneMode)
Declaration
public static AsyncOperation LoadSceneAsync(int sceneBuildIndex, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
Parameters
Returns
|
Improve this Doc
View Source
LoadSceneAsync(Int32, LoadSceneParameters)
Declaration
public static AsyncOperation LoadSceneAsync(int sceneBuildIndex, LoadSceneParameters parameters)
Parameters
Returns
|
Improve this Doc
View Source
LoadSceneAsync(String)
Declaration
[ExcludeFromDocs]
public static AsyncOperation LoadSceneAsync(string sceneName)
Parameters
Type |
Name |
Description |
String |
sceneName |
|
Returns
|
Improve this Doc
View Source
LoadSceneAsync(String, LoadSceneMode)
Declaration
public static AsyncOperation LoadSceneAsync(string sceneName, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
Parameters
Returns
|
Improve this Doc
View Source
LoadSceneAsync(String, LoadSceneParameters)
Declaration
public static AsyncOperation LoadSceneAsync(string sceneName, LoadSceneParameters parameters)
Parameters
Returns
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
SetActiveScene(Scene)
Declaration
public static bool SetActiveScene(Scene scene)
Parameters
Type |
Name |
Description |
Scene |
scene |
|
Returns
|
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
|
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
|
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
|
Improve this Doc
View Source
UnloadSceneAsync(Int32)
Declaration
public static AsyncOperation UnloadSceneAsync(int sceneBuildIndex)
Parameters
Type |
Name |
Description |
Int32 |
sceneBuildIndex |
|
Returns
|
Improve this Doc
View Source
UnloadSceneAsync(String)
Declaration
public static AsyncOperation UnloadSceneAsync(string sceneName)
Parameters
Type |
Name |
Description |
String |
sceneName |
|
Returns
|
Improve this Doc
View Source
UnloadSceneAsync(Scene)
Declaration
public static AsyncOperation UnloadSceneAsync(Scene scene)
Parameters
Type |
Name |
Description |
Scene |
scene |
|
Returns
Events
|
Improve this Doc
View Source
activeSceneChanged
Declaration
public static event UnityAction<Scene, Scene> activeSceneChanged
Event Type
|
Improve this Doc
View Source
sceneLoaded
Declaration
public static event UnityAction<Scene, LoadSceneMode> sceneLoaded
Event Type
|
Improve this Doc
View Source
sceneUnloaded
Declaration
public static event UnityAction<Scene> sceneUnloaded
Event Type
Extension Methods