【背景】
不废话了,这个当然是最常用的。写个脚本,把方法挂载在Button元素的动作上就可以了。
【脚本】
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class jumpScene : MonoBehaviour
{
public void QuitGame()
{
Application.Quit();
}
}
核心方法是QuitGame