用户工具

站点工具


侧边栏

script:unityengine:classes:transform:transform.localrotation

Transform.localRotation 局部旋转

JavaScript ⇒ var localRotation: Quaternion;
C# ⇒ Quaternion localRotation;

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为设置作为欧拉角的旋转角度。

JavaScript:

	// Set the rotation to be the same as the parent
	transform.localRotation = Quaternion.identity;

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void Example() {
        transform.localRotation = Quaternion.identity;
    }
}

Transform

script/unityengine/classes/transform/transform.localrotation.txt · 最后更改: 2016/08/02 05:37 (外部编辑)