My solution to move to the next level

I am pretty sure that this isn’t the correct way to do so, but I tought it could be funny to share my idea to cycle through scenes :rofl:

    private void ReLoadLevel() {
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
    }

    private void LoadNextLevel() {
        if (SceneManager.GetActiveScene().buildIndex <= SceneManager.sceneCount - 1)
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
        else
            SceneManager.LoadScene(0);
    }

Privacy & Terms