重載1:
static Quaternion Euler (float x ,float y,float z)Description:
Returns a rotation that rotates z degrees around the z axis, x degrees around the x axis, and y degrees around the y axis (in that order).描述:
返回一個旋轉角度,繞z軸旋轉z度,繞x軸旋轉x度,繞y軸旋轉y度(像這樣的順序)。
具體使用代碼如下:
//將transform中的rotation修改成(0,30,0) Quaternion rotation = Quaternion.Euler(0f, 30f, 0f); transform.rotation = rotation;
重載2:
static Quaternion Euler (Vector3 rotationVector3)Description:
Returns a rotation that rotates z degrees around the z axis, x degrees around the x axis, and y degrees around the y axis (in that order).描述:
返回一個旋轉角度,繞z軸旋轉z度,繞x軸旋轉x度,繞y軸旋轉y度(像這樣的順序)。
具體使用代碼如下:
//將transform中的rotation修改成(0,30,0) Vector3 rotationVector3 = new Vector3(0f, 30f, 0f); Quaternion rotation = Quaternion.Euler(rotationVector3); transform.rotation = rotation;
原創文章,轉載請注明出