这个方法不是作一个射线来PICK物品。是用了U3D中一个比较方便的API来实现的,非常简单。
int speed = 10;
void OnMouseDrag () {
transform.position += Vector3.right * Time.deltaTime*Input.GetAxis ("Mouse X") * speed;
transform.position += Vector3.forward * Time.deltaTime*Input.GetAxis ("Mouse Y")* speed;;
}
int speed = 10;
void OnMouseDrag () {
transform.position += Vector3.right * Time.deltaTime*Input.GetAxis ("Mouse X") * speed;
transform.position += Vector3.forward * Time.deltaTime*Input.GetAxis ("Mouse Y")* speed;;
}