unity change scenes via script code example
Example 1: how do you switch scenes unity
using UnityEngine.SceneManagement;
SceneManager.LoadScene('Scene');
Example 2: load scene unity
using UnityEngine.SceneManagement
public class LoadScene : MonoBehavior
{
public string sceneToLoad = "Level2";
public void Start()
{
SceneManager.LoadScene(sceneToLoad);
}
}