Event.isKey 键盘事件?
var isKey : bool
Description描述
Is this event a keyboard event? (Read Only)
这个事件是键盘事件么(只读)?
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnGUI() {
Event e = Event.current;
if (e.isKey)
Debug.Log("Detected a keyboard event!");
}
}
// Detects any keyboard event
//检测任意键盘事件
function OnGUI() {
var e : Event = Event.current;
if (e.isKey){
Debug.Log("Detected a keyboard event!");
}
}
最后修改:2010年12月31日 Friday 22:29