1.输出鼠标位置
在Update方法中:
Debug.Log(Input.mouseposition);
2.判断鼠标是否点击,返回 True 和 false(每帧都输出)
在Update方法中:
Debug.Log(Input.anykey);
3.Input . inputstring 返回你在本次update里面输入的assic字符 (键盘打什么就输出什么)
if(Input.inputstring.Length > 0)
{
Debug.Log(Input.inputstring);
}
4.重力加速度的方向(也就是重力感应,若没有重力传感器,Debug . Log 它时就会输出(0,0,0);因为它是vector3的对象)
Input.acceleration
5.监听触摸事件
默认是单点触摸,想开启多点触摸:
在Start()方法中:
Input.multiTouchEnabled = true;
触摸的几个状态(单点)