UnityEngine.SceneManagement.SceneManager.LoadScene C# (CSharp) Method

LoadScene() public static method

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.
return void
        public static void LoadScene(string sceneName, [DefaultValue("LoadSceneMode.Single")] LoadSceneMode mode)
        {
            LoadSceneAsyncNameIndexInternal(sceneName, -1, mode == LoadSceneMode.Additive, true);
        }

Same methods

SceneManager::LoadScene ( int sceneBuildIndex ) : void
SceneManager::LoadScene ( int sceneBuildIndex, [ mode ) : void
SceneManager::LoadScene ( string sceneName ) : void

Usage Example

Beispiel #1
0
    public void LoadScene(string sceneName)
    {
        prevScene = currentScene;


        UnitySceneManager.LoadScene(sceneName);
    }
All Usage Examples Of UnityEngine.SceneManagement.SceneManager::LoadScene