按ESC键,弹出界面,点击“退出程序”按钮,程序结束。
using UnityEngine;
using System.Collections;
public class guanbicaidan : MonoBehaviour {
public GameObject a;
// Use this for initialization
void Start () {
a.SetActive (false);
}
// Update is called once per frame
void Update () {
if (Input.GetKey (KeyCode.Escape)) {
a.SetActive (true);
}
}
}
using UnityEngine;
using System.Collections;
public class guanbicaidan : MonoBehaviour {
public GameObject a;
// Use this for initialization
void Start () {
a.SetActive (false);
}
// Update is called once per frame
void Update () {
if (Input.GetKey (KeyCode.Escape)) {
a.SetActive (true);
}
}
}