Version: 2023.2
public static Quaternion AngleAxis (float angle, Vector3 axis);

描述

创建一个围绕 axis 旋转 angle 度的旋转。

有关更多信息,请参阅 Unity 中的旋转和方向。不应用轴参数的量级。

using UnityEngine;

public class Example : MonoBehaviour { void Start() { // Sets the transform's current rotation to a new rotation that rotates 30 degrees around the y-axis(Vector3.up) transform.rotation = Quaternion.AngleAxis(30, Vector3.up); } }