Transform.localRotation 自身旋转角度

var localRotation : Quaternion

Description描述

The rotation of the transform relative to the parent transform's rotation.

物体变换的旋转角度相对于父级的物体变换的旋转角度。

Unity stores rotations as Quaternions internally. To rotate an object, use Transform.Rotate. Use Transform.localEulerAngles for modifying the rotation as euler angles.

Untiy作为四元数内部储存旋转角度。旋转一个物体,使用Transform.Rotate,使用Transform.localEulerAngles为设置作为欧拉角的旋转角度。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public void Awake() {
		transform.localRotation = Quaternion.identity;
	}
}
// Set the rotation to be the same as the parent
//设置旋转角度同父级一样。
transform.localRotation = Quaternion.identity;
Page last updated: 2010-12-18