How to load next scene in current scene?



private void LoadNextScene()

{

    // get current scene

    Scene scene = SceneManager.GetActiveScene();


    // get current scene build order(index)

    int curScene = scene.buildIndex;


    // increase index to get next scene

    int nextScene = curScene + 1;


    // load next scene

    SceneManager.LoadScene(nextScene)

}


What is build order?

It means that build order in build Setting. (Check scene numbering such as 0, 1, 2, 3...)



That's all to get next scene based on the currently active scene.