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

Same methods

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

Usage Example

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


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