if(Input.GetMouseButton(1)) {//控制上下左右旋转 obj.transform.Rotate(Vector3.up, -Time.deltaTime * 200 * Input.GetAxis("Mouse X")); obj.transform.Rotate(Vector3.right, Time.deltaTime * 200 * Input.GetAxis("Mouse Y")); } if (Input.GetAxis("Mouse ScrollWheel") != 0&&obj.renderer.material.color==Color.red) { scrow=Input.GetAxis("Mouse ScrollWheel"); obj.transform.position += (transform.position - obj.transform.position).normalized * scrow; }