Horizontal,vertical,Input_Mouse,Input_Key
鼠标获取
using UnityEngine;
using System.Collections; public class Input_Mouse : MonoBehaviour { void Update()
{
// if (Input.GetMouseButtonDown (0)) {
// Debug.Log ("按下了鼠标左键");
// }
//
// if (Input.GetMouseButtonUp (0)) {
// Debug.Log ("抬起了鼠标左键");
// }
//
// if (Input.GetMouseButton (0)) {
// Debug.Log ("按住了鼠标左键");
// } Debug.Log (Input.mousePosition);
}
}
按键获取
using UnityEngine;
using System.Collections; public class Input_Key : MonoBehaviour { void Update()
{
//当用户按下了空格键盘,if成立(为真)
if (Input.GetKeyDown (KeyCode.Space)) {
Debug.Log ("按下了空格!!!");
} if (Input.GetKey (KeyCode.Space)) {
Debug.Log ("按住了空格!!!");
} if (Input.GetKeyUp (KeyCode.Space)) {
Debug.Log ("抬起了空格!!!");
}
}
}
WASD获取
using UnityEngine; using System.Collections; public class Virtual : MonoBehaviour { void Update() { float h = Input.GetAxis ("Horizontal"); float v = Input.GetAxis ("Vertical"); Debug.Log (v); } }
Horizontal,vertical,Input_Mouse,Input_Key的更多相关文章
- HTML5移动开发学习笔记之CSS3基础学习
CSS回顾 在学CSS3之前首先巩固下CSS的基础知识. 1.CSS框模型 举例子: #box { width: 70px; margin: 10px; padding: 5px; } 这个代码将出现 ...
- gridview安卓实现单行多列横向滚动
<GridLayout android:layout_width="match_parent" android:layout_height="match_paren ...
- [LeetCode] Design Tic-Tac-Toe 设计井字棋游戏
Design a Tic-tac-toe game that is played between two players on a n x n grid. You may assume the fol ...
- [LeetCode] Game of Life 生命游戏
According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellul ...
- flex的兼容
父容器的 display 属性: .box{ display: -webkit-box; /* 老版本语法: Safari, iOS, Android browser, older WebKit br ...
- (转)详解css3弹性盒模型(Flexbox)
今天刚学了css3的弹性盒模型,这是一个可以让你告别浮动.完美实现垂直水平居中的新特性. Flexbox是布局模块,而不是一个简单的属性,它包含父元素和子元素的属性. Flexbox布局的主体思想是似 ...
- CSS魔法堂:Box-Shadow没那么简单啦:)
前言 说起box-shadow那第一个想法当然就是用来实现阴影,其实它还能用于实现其他好玩的效果的,本篇就打算说说box-shadow的那些事. 二话不说看效果 3D小球 <style typ ...
- Android开发5:应用程序窗口小部件App Widgets的实现
前言 本次主要是实现一个Android应用,实现静态广播.动态广播两种改变 widget内容的方法,即在上篇博文中实验的基础上进行修改,所以此次实验的重点是AppWidget小部件的实现啦~ 首先,我 ...
- Android开发1:基本UI界面设计——布局和组件
前言 啦啦啦~本学期要开始学习Android开发啦~ 博主在开始学习前是完完全全的小白,只有在平时完成老师要求的实验的过程中一步一步学习~从此篇博文起,博主将开始发布Android开发有关的博文,希望 ...
随机推荐
- css09浮动属性
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- poj 3349 (最小表示法)
开始按hash做的 交上去就wa 但是和标称拍了半天也没有不一样的 可能是生成的数据太水了吧... #include<iostream> #include<cstdio> #i ...
- 安装VS2013的离线MSDN帮助文档
作为vs的初学者,安装帮助文档有利于快速掌握.net的基本语法,对于摸索学习的同学帮助很大. VS2013和VS2012的帮助文档目前为止还是一样 下面是下载地址 http://www.micr ...
- Windows Media Player Plus
Windows Media Player Plus 是一款 Windows Media Player 的插件,提供很多实用功能,Mark 一下.
- nosqlunit开源框架
import com.lordofthejars.nosqlunit.annotation.UsingDataSet;import com.lordofthejars.nosqlunit.core.L ...
- 记一次T-SQL查询优化 索引的重要性
概述 在一次调优一个项目组件的性能问题时,发现SQL的设计真的是非常的重要,所以写一篇博文来记录总结一下. 环境介绍 这个项目组件是一个Window服务,内部在使用轮循机会在处理一个事件表中的事件,将 ...
- Arcgis Desktop 9.3 安装
以下用到的 Crack在我的网盘中有: ref: http://pan.baidu.com/s/1pJJlVBl 密码: p4gk 一,安装 Desktop(依次按照如图安装): 二,配置 1,以上步 ...
- 解决Windows服务1053错误方法
WCF使用MSMQ绑定寄宿在Windows服务上,但启动服务时出现1053错误 在网上搜索了N多解决方案,都是比较高深的扯到原理和系统bug等问题 看了看到最后也没有解决,最终我决定使用一个比较山寨的 ...
- query等待ajax执行完毕再继续执行下面代码的操作
Jquery等待ajax执行完毕再继续执行下面代码的效果,具体代码如下,其实就是将 jquery ajax 函数的 async 参数设置为 false 即可,该参数默认为 true: $(docume ...
- 安装SQL Server 那些事儿
SQL版本: Microsoft SQL Server2008 R2 RTM - Express with Advanced Services 错误描述: System.Configuration.C ...