button to change scene programmatically

  1. I add an empty game object. I attach my new script.
    public void NextLevelButton(string levelName)
    {
        SceneManager.LoadScene(levelName);
    }
    
  2. I associate this game object with my new script to the Button(in the inspector) by: Clicking the +(plus) button to add a callback from an object->script->method.

Link