欧拉角和四元数的恩爱情仇

欧拉角转四元数:

//
// 摘要:
//     ///
//     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).
//     ///
//
// 参数:
//   euler:
public static Quaternion Euler(Vector3 euler);
//
// 摘要:
//     ///
//     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).
//     ///
//
// 参数:
//   x:
//
//   y:
//
//   z:
public static Quaternion Euler(float x, float y, float z);

四元数转欧拉角(获取欧拉角)

//
// 摘要:
//     ///
//     Returns the euler angle representation of the rotation.
//     ///
public Vector3 eulerAngles { get; set; }

直接设置欧拉角

transform.eulerAngles = new Vector3(0,0,0);