Unity之快捷键组合
2016-06-12 00:51
363 查看
#region 快捷键 bool isDown = false; KeyCode currentKey; void Update() { // 普通奖 if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad0)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 0 普通奖"); } //幸运送次数 幸运座位,在正常中奖的前提下,多送1--11个动物 (恭喜发财) if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad1)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 1 幸运送次数"); } //送颜色(同颜色中奖) if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad2)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 2 送颜色"); } //送动物(同动物中奖) if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad3)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 3 送动物"); } //送彩金 if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad4)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 4 送彩金"); } //幸运彩金 if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad5)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 5 幸运彩金"); } //幸运送颜色 if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad6)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 6 幸运送颜色"); } //幸运送动物 if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad7)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 7 幸运送动物"); } //幸运大满贯 if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad8)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 8 幸运大满贯"); } //棒棒糖(送灯) if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.Keypad9)) { if (isDown) return; isDown = true; Debug.LogError("CTRL + 9 棒棒糖(送灯)"); } //超级大乐透 if (Input.GetKey(KeyCode.LeftAlt) && Input.GetKey(KeyCode.Keypad0)) { if (isDown) return; isDown = true; Debug.LogError("ALt + 0 棒棒糖(送灯)"); } //抬起键 if (Input.GetKeyUp(KeyCode.LeftControl) || Input.GetKeyUp(KeyCode.RightControl) || Input.GetKeyUp(KeyCode.LeftAlt)) { isDown = false; Debug.LogError("抬起"); } } #endregion
相关文章推荐
- unity实现多点触控代码
- 在Unity中实现动画的正反播放代码
- Unity UGUI教程之实现滑页效果
- unity实现摄像头跟随
- Unity3D上路_01-2D太空射击游戏
- Unity3D上路_02-第一视角射击游戏
- Unity3D上路_03-塔防游戏
- Unity3D上路_04-基础资源介绍
- Unity3D上路_05-网络相关
- Unity3D-5.3.5发布VR项目到Android
- [软件资讯]Unity已支持将3D游戏导出成Flash
- ShaderLab: Pass
- Unity 武器拖尾效果
- unity常见问题之20题
- Unity3D动画存储插件
- unity 赛车相机跟随物体移动
- uLua中遇到的问题
- Unity3d 协程、调用函数、委托
- Unity3d摄像机Camera参数详解
- Unity3d多线程