-
float h = Input.GetAxis("Horizontal");
float v = Input.GetAxis("Vertical");Quaternion oldRotate = transform.rotation;
transform.Rotate(Vector3.right * -h * speed * Time.deltaTime);
transform.Rotate(Vector3.forward * -v * speed * Time.deltaTime);if ((transform.localEulerAngles.x >= 8.0f && transform.localEulerAngles.x <= 353.0f)||
(transform.localEulerAngles.z >= 8.0f && transform.localEulerAngles.z <= 345.0f))
{
transform.rotation = oldRotate;
可以了 谢谢啊 第一种方法倒是懂,第二种方法倒没见过不知道具体怎么用