13. User Interface

using UnityEngine;
using UnityEngine.SceneManagement;

public class MainMenu : MonoBehaviour
{
    public void PlayGame()
    {
        SceneManager.LoadScene(1);  // Loads the scene with index 1
    }

    public void QuitGame()
    {
        //Application.Quit();  // Doesn't work when the game is running in the Unity editor
        UnityEditor.EditorApplication.isPlaying = false;  // Stops running the game if it is running in the Unity editor
    }
}
< ^ >