首页 > 编程语言 > 详细

Unity任意按键检测并输出键值

时间:2016-06-17 12:23:21      阅读:311      评论:0      收藏:0      [点我收藏+]
 1 using UnityEngine;
 2 using System.Collections;
 3 
 4 public class PressKeyCheckScript : MonoBehaviour {
 5 
 6     // Use this for initialization
 7     void Start () {
 8     
 9     }
10     
11     // Update is called once per frame
12     void Update () {
13     
14     }
15     void OnGUI(){
16         Event a = Event.current;
17         if(a.isKey)
18             Debug.Log("press: "+ a.keyCode);
19     }
20 }

 

Unity任意按键检测并输出键值

原文:http://www.cnblogs.com/Haleclipse/p/5593562.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!