在unity3d中,当按下“Esc”键时,使生成的程序关闭的C#代码如何写?
星期三, 06/16/2010 - 17:48
在unity3d中,当按下“Esc”键时,生成的程序关闭的C#代码如何写,我是新手不太懂,希望大虾们帮帮忙

在unity3d中,当按下“Esc”键时,生成的程序关闭的C#代码如何写,我是新手不太懂,希望大虾们帮帮忙
版权所有:U吧 | 苏ICP备09074495号 | 官方QQ群:71812166 | email: unity3d8@gmail.com | 站点帮助

using UnityEngine;
using System.Collections;
public class CLASSNAME : MonoBehaviour {
void Update (){
if (Input.GetKey ("escape")) {
Application.Quit();
}
}
}
可参考js代码:
function Update () {
if (Input.GetKey ("escape")) {
Application.Quit();
}
}
转换为c#代码即可!