**
物体跟随鼠标旋转
**
Mathf.Clamp(,)把数值限制在最大和最小之间,value小于min返回min,大于max,返回max
private float maxYRotation = 120;
private float minYRotation = 0;
private float maxXRotation = 60;
private float minXRotation = 0;
float xPosPer = Input.mousePosition.x / Screen.width;`//鼠标在x方向于屏幕的比例`
float yPosPer = Input.mousePosition.y / Screen.height;//鼠标在y方向于屏幕的比例
float xAngle = -Mathf.Clamp(yPosPer*maxXRotation,minXRotation,maxYRotation)+15;
float yAngle = Mathf.Clamp(xPosPer * maxYRotation, minXRotation, maxYRotation) - 60;
transform.eulerAngles = new Vector3(xAngle,yAngle,0);