退出游戏
public void Quit() { Application.Quit(); }
重新开始(适用unity5.3以上的版本)
using UnityEngine;using System.Collections;using UnityEngine.SceneManagement;public class restart : MonoBehaviour { public void Restart() { SceneManager.LoadScene(0); }}
然后在unity里对button按钮进行赋值