Input.GetAxis _ Unity3d
来源:互联网 发布:匡恩网络有前途吗 编辑:程序博客网 时间:2024/06/10 15:54
Input.GetAxis 获取轴
static function GetAxis (axisName : string) : float
Description描述
Returns the value of the virtual axis identified by axisName.
根据坐标轴名称返回虚拟坐标系中的值。
The value will be in the range -1...1 for keyboard and joystick input. If the axis is setup to be delta mouse movement, the mouse delta is multiplied by the axis sensitivity and the range is not -1...1.
使用控制器和键盘输入时此值范围在-1到1之间。如果坐标轴设置为鼠标运动增量,鼠标增量乘以坐标轴灵敏度的范围将不是-1到1 。
- C#
- JavaScript
// A very simplistic car driving on the x-z plane.// 一个十分简单的在x-z平面的驾车例子var speed : float = 10.0;var rotationSpeed : float = 100.0;function Update () {// Get the horizontal and vertical axis.//获取横向和纵向坐标轴// By default they are mapped to the arrow keys.//默认情况下他们关联到方向键上// The value is in the range -1 to 1//值的范围是在-1到1之间var translation : float = Input.GetAxis ("Vertical") * speed;var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;// Make it move 10 meters per second instead of 10 meters per frame...// 使它每帧移动10米变为每秒移动10米...translation *= Time.deltaTime;rotation *= Time.deltaTime;// Move translation along the object's z-axis//沿着z轴平移对象transform.Translate (0, 0, translation);// Rotate around our y-axis//以我们的y轴为中心旋转transform.Rotate (0, rotation, 0);}
- C#
- JavaScript
// Performs a mouse look.//执行一个鼠标观察var horizontalSpeed : float = 2.0;var verticalSpeed : float = 2.0;function Update () {// Get the mouse delta. This is not in the range -1...1//获取鼠标增量,范围不在-1...1var h : float = horizontalSpeed * Input.GetAxis ("Mouse X");var v : float = verticalSpeed * Input.GetAxis ("Mouse Y");transform.Rotate (v, h, 0);}
0 0
- Input.GetAxis _ Unity3d
- Unity3D之float Input.GetAxis(string axisname)
- Input.GetAxis
- Input.GetAxis();
- Input.GetAxis
- Input.GetAxis
- unity3d学习j记录之 API阅读-001Input.GetAxis
- unity Input.GetAxis()函数
- Input.GetAxis()
- Input.GetAxisRaw 与Input.GetAxis
- Input.GetAxisRaw 与Input.GetAxis
- 我的和unity3d的小故事1——恶魔射手之鼠标控制移动之input.getaxis("Horizontal")与input.getaxis("Vertical")
- unity Input.GetAxis和Input.GetAxisRaw
- Unity 3D input.GetAxis用法
- 【转】Input.GetAxisRaw 与Input.GetAxis的区别
- Unity 方向键输入 Input.GetAxis() 和Input.GetAxisRaw()
- Unity中Input.GetAxis方法的返回值含义
- unity3d 手机中Input类中touch详解_教程
- jQuery学习笔记(2)
- jquery对select的操作
- AWR报告分析
- flex入门关于Flex与Flash之间有什么关系
- 将mysql执行结果按照固定格式写入文件
- Input.GetAxis _ Unity3d
- 部分内容5--sys灯
- Java基础、Java集合、多线程、JDBC、HTTP、JSP、Servlet、Struts面试题汇总(附答案)
- unix高级环境编程 第二十章 数据库函数库:习题讨论
- [ CSS ] div宽度自适应!
- 本地项目代码有了,建立zend studio 9.04 项目如何做?
- MongoDB基本使用
- 国外大学生谈经验:如何在Github参与开源(Open Source on Github: Your First Contribution)
- jar 转换成dll