插值转向
//控制转向---插值转向--这段代码要写在最后
//transform.LookAt(transform.position + dir.normalized);
Quaternion myRotation = Quaternion.LookRotation(dir.normalized, Vector3.up);
Quaternion newRotation = Quaternion.Lerp(transform.rotation, myRotation, rotateSpeed * Time.deltaTime);
transform.rotation = newRotation;