var from : Vector2;
function OnMouseDown(){
var from = Input.mousePosition;
while (Input.GetMouseButton(1)){
var offset = from - Input.mousePosition;
transform.Rotate(Vector3.up*offset.x,Space.World);
//transform.Rotate(Vector3.right*offset.y,Space.World);
from = Input.mousePosition;
yield;
}}
我把GetMouseButton设置成0就好使,设置成1就不好使,我左键已经设置成移动了,向右键旋转,应该怎么样去修改,新手求教
function OnMouseDown(){
var from = Input.mousePosition;
while (Input.GetMouseButton(1)){
var offset = from - Input.mousePosition;
transform.Rotate(Vector3.up*offset.x,Space.World);
//transform.Rotate(Vector3.right*offset.y,Space.World);
from = Input.mousePosition;
yield;
}}
我把GetMouseButton设置成0就好使,设置成1就不好使,我左键已经设置成移动了,向右键旋转,应该怎么样去修改,新手求教