C# Class UnityEngine.SceneManagement.SceneManager

Afficher le fichier Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Méthodes publiques

Méthode Description
CreateScene ( string sceneName ) : Scene

Create an empty new scene at runtime with the given name.

GetActiveScene ( ) : Scene

Gets the currently active scene.

GetSceneAt ( int index ) : Scene

Get the scene at index in the SceneManager's list of added scenes.

GetSceneByBuildIndex ( int buildIndex ) : Scene

Get a scene struct from a build index.

GetSceneByName ( string name ) : Scene

Searches through the scenes added to the SceneManager for a scene with the given name.

GetSceneByPath ( string scenePath ) : Scene

Searches all scenes added to the SceneManager for a scene that has the given asset path.

LoadScene ( int sceneBuildIndex, [ mode ) : void

Loads the scene by its name or index in Build Settings.

LoadScene ( string sceneName, [ mode ) : void

Loads the scene by its name or index in Build Settings.

LoadSceneAsync ( int sceneBuildIndex, [ mode ) : AsyncOperation

Loads the scene asynchronously in the background.

LoadSceneAsync ( string sceneName, [ mode ) : AsyncOperation

Loads the scene asynchronously in the background.

MergeScenes ( Scene sourceScene, Scene destinationScene ) : void

This 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.

MoveGameObjectToScene ( GameObject go, Scene scene ) : void

Move 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.

SetActiveScene ( Scene scene ) : bool

Set the scene to be active.

UnloadSceneAsync ( Scene scene ) : AsyncOperation

Destroyes all GameObjects associated with the given scene and removes the scene from the SceneManager.

UnloadSceneAsync ( int sceneBuildIndex ) : AsyncOperation

Destroyes all GameObjects associated with the given scene and removes the scene from the SceneManager.

UnloadSceneAsync ( string sceneName ) : AsyncOperation

Destroyes all GameObjects associated with the given scene and removes the scene from the SceneManager.

Private Methods

Méthode Description
GetAllScenes ( ) : UnityEngine.SceneManagement.Scene[]
INTERNAL_CALL_CreateScene ( string sceneName, Scene &value ) : void
INTERNAL_CALL_GetActiveScene ( Scene &value ) : void
INTERNAL_CALL_GetSceneAt ( int index, Scene &value ) : void
INTERNAL_CALL_GetSceneByBuildIndex ( int buildIndex, Scene &value ) : void
INTERNAL_CALL_GetSceneByName ( string name, Scene &value ) : void
INTERNAL_CALL_GetSceneByPath ( string scenePath, Scene &value ) : void
INTERNAL_CALL_MergeScenes ( Scene &sourceScene, Scene &destinationScene ) : void
INTERNAL_CALL_MoveGameObjectToScene ( GameObject go, Scene &scene ) : void
INTERNAL_CALL_SetActiveScene ( Scene &scene ) : bool
Internal_ActiveSceneChanged ( Scene previousActiveScene, Scene newActiveScene ) : void
Internal_SceneLoaded ( Scene scene, LoadSceneMode mode ) : void
Internal_SceneUnloaded ( Scene scene ) : void
LoadScene ( int sceneBuildIndex ) : void
LoadScene ( string sceneName ) : void
LoadSceneAsync ( int sceneBuildIndex ) : AsyncOperation
LoadSceneAsync ( string sceneName ) : AsyncOperation
LoadSceneAsyncNameIndexInternal ( string sceneName, int sceneBuildIndex, bool isAdditive, bool mustCompleteNextFrame ) : AsyncOperation
UnloadScene ( Scene scene ) : bool
UnloadScene ( int sceneBuildIndex ) : bool
UnloadScene ( string sceneName ) : bool
UnloadSceneNameIndexInternal ( string sceneName, int sceneBuildIndex, bool immediately, bool &outSuccess ) : AsyncOperation

Method Details

CreateScene() public static méthode

Create an empty new scene at runtime with the given name.

public static CreateScene ( string sceneName ) : Scene
sceneName string The name of the new scene. It cannot be empty or null, or same as the name of the existing scenes.
Résultat Scene

GetActiveScene() public static méthode

Gets the currently active scene.

public static GetActiveScene ( ) : Scene
Résultat Scene

GetSceneAt() public static méthode

Get the scene at index in the SceneManager's list of added scenes.

public static GetSceneAt ( int index ) : Scene
index int Index of the scene to get. Index must be greater than or equal to 0 and less than SceneManager.sceneCount.
Résultat Scene

GetSceneByBuildIndex() public static méthode

Get a scene struct from a build index.

public static GetSceneByBuildIndex ( int buildIndex ) : Scene
buildIndex int Build index as shown in the Build Settings window.
Résultat Scene

GetSceneByName() public static méthode

Searches through the scenes added to the SceneManager for a scene with the given name.

public static GetSceneByName ( string name ) : Scene
name string Name of scene to find.
Résultat Scene

GetSceneByPath() public static méthode

Searches all scenes added to the SceneManager for a scene that has the given asset path.

public static GetSceneByPath ( string scenePath ) : Scene
scenePath string Path of the scene. Should be relative to the project folder. Like: "AssetsMyScenesMyScene.unity".
Résultat Scene

LoadScene() public static méthode

Loads the scene by its name or index in Build Settings.

public static LoadScene ( int sceneBuildIndex, [ mode ) : void
sceneBuildIndex int Index of the scene in the Build Settings to load.
mode [ Allows you to specify whether or not to load the scene additively. /// See SceneManagement.LoadSceneMode for more information about the options.
Résultat void

LoadScene() public static méthode

Loads the scene by its name or index in Build Settings.

public static LoadScene ( string sceneName, [ mode ) : void
sceneName string Name or path of the scene to load.
mode [ Allows you to specify whether or not to load the scene additively. /// See SceneManagement.LoadSceneMode for more information about the options.
Résultat void

LoadSceneAsync() public static méthode

Loads the scene asynchronously in the background.

public static LoadSceneAsync ( int sceneBuildIndex, [ mode ) : AsyncOperation
sceneBuildIndex int Index of the scene in the Build Settings to load.
mode [ If LoadSceneMode.Single then all current scenes will be unloaded before loading.
Résultat UnityEngine.AsyncOperation

LoadSceneAsync() public static méthode

Loads the scene asynchronously in the background.

public static LoadSceneAsync ( string sceneName, [ mode ) : AsyncOperation
sceneName string Name or path of the scene to load.
mode [ If LoadSceneMode.Single then all current scenes will be unloaded before loading.
Résultat UnityEngine.AsyncOperation

MergeScenes() public static méthode

This 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.

public static MergeScenes ( Scene sourceScene, Scene destinationScene ) : void
sourceScene Scene The scene that will be merged into the destination scene.
destinationScene Scene Existing scene to merge the source scene into.
Résultat void

MoveGameObjectToScene() public static méthode

Move 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.

public static MoveGameObjectToScene ( GameObject go, Scene scene ) : void
go UnityEngine.GameObject GameObject to move.
scene Scene Scene to move into.
Résultat void

SetActiveScene() public static méthode

Set the scene to be active.

public static SetActiveScene ( Scene scene ) : bool
scene Scene The scene to be set.
Résultat bool

UnloadSceneAsync() public static méthode

Destroyes all GameObjects associated with the given scene and removes the scene from the SceneManager.

public static UnloadSceneAsync ( Scene scene ) : AsyncOperation
scene Scene Scene to unload.
Résultat UnityEngine.AsyncOperation

UnloadSceneAsync() public static méthode

Destroyes all GameObjects associated with the given scene and removes the scene from the SceneManager.

public static UnloadSceneAsync ( int sceneBuildIndex ) : AsyncOperation
sceneBuildIndex int Index of the scene in BuildSettings.
Résultat UnityEngine.AsyncOperation

UnloadSceneAsync() public static méthode

Destroyes all GameObjects associated with the given scene and removes the scene from the SceneManager.

public static UnloadSceneAsync ( string sceneName ) : AsyncOperation
sceneName string Name or path of the scene to unload.
Résultat UnityEngine.AsyncOperation