查看虚拟轴:Edit / project settings / Input
1.Horizontal 水平轴
Name:Horizontal (默认就是“Horizontal”,这里可以修改它的名字,一般不动它)
---
---这两个是对轴的描述
Negative Button :Left (负轴,键盘左键)
Positive Button:right (正轴,键盘右键)
Alt Negative Button :a (备用键负轴,A键)
Alt Positive Button :d (备用键正轴,D键)
Gravity :3 (恢复为0的速度,越大越快)
Dead : 0.001 (过度的精细度,小于此数计为0)
Sensitivity :3 (0到1的速度,越大越快)
Invert (如果勾选此项,方向则为反向)
float horizontal = Input.GetAxis("Horizontal");
2.Vertical 垂直轴(同上)
3.Fire1
监听 Left Ctrl键和鼠标左键
if(Input.GetBttonDown("Fire1")
{
Debug.Log("开火");
}
4.Jump
跳——空格键
5.Mouse X 鼠标移动(左右)
向左移为负轴,向右移为正轴
float mouseX = input.GetAxis("Mouse X");
6.Mouse Y 鼠标移动(上下)
7.Mouse ScrollWheel 鼠标滚轮