按键操作:
1.Input.GetKey(KeyCode keyCode):一直按着,一直返回true;
2.Input.GetKeyDown:按键按下时,返回true
3.Input.GetKeyUp:按键抬起时,返回true
鼠标:
1.Input.GetMouseButton(0)//0,1,2分别对应左右中
2.Input.GetMouseButtonDown()
3.Input.GetMouseButtonUp()
特定的轴对应特定的键盘/鼠标(按下/移动)/外接摇杆(Unity默认有18个轴):
设置虚拟轴:菜单栏Edit-ProjectSettings-Input
1.Input.GetAxis("虚拟轴名");
Horizontal:水平轴(ad/左右)
Vertical:垂直轴(ws/上下)
Mouse X:鼠标在水平轴上的移动距离
Mouse Y:鼠标在垂直轴上的移动距离