angle += state.ThumbSticks.Left.Y * 25.0f * Time.deltaTime;//俯仰角
var kk = Mathf.Clamp(angle, -30, 30);
Quaternion _kk = new Quaternion();
_kk = Quaternion.AngleAxis(kk, Vector3.left);//上下旋转
angle2 += state.ThumbSticks.Left.X * 25.0f * Time.deltaTime;//俯仰角
Quaternion _kk2 = new Quaternion();
_kk2 = Quaternion.AngleAxis(angle2, Vector3.up);//左右旋转
var gg = _kk * originRotation;
My.transform.localRotation = _kk2 * gg;
时间: 2024-11-07 03:35:11