用户工具

站点工具


侧边栏

script:unityengine:classes:transform:transform.localeulerangles

Transform.localEulerAngles 局部欧拉角

JavaScript ⇒ var localEulerAngles: Vector3;
C# ⇒ Vector3 localEulerAngles;

Description 描述

The rotation as Euler angles in degrees relative to the parent transform's rotation.

旋转作为欧拉角度,相对于父级的变换旋转。

The x, y, and z angles represent a rotation 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角代表绕z轴旋转z度,绕x轴旋转x度,绕y轴旋转y度(这个顺序)。

Only use this variable to read and set the angles to absolute values. Don't increment them, as it will fail when the angle exceeds 360 degrees. Use Transform.Rotate instead.

仅使用这个变量读取和设置角度为绝对值。不要递增它们,当超过角度360度,它将错误。使用Transform.Rotate替代。

JavaScript:

	// Print the rotation around the parent's X Axis
	print (transform.localEulerAngles.x);
	// Print the rotation around the parent's Y Axis
	print (transform.localEulerAngles.y);
	// Print the rotation around the parent's Z Axis
	print (transform.localEulerAngles.z);

C#:

using UnityEngine;
using System.Collections;
 
public class ExampleClass : MonoBehaviour {
    void Example() {
        print(transform.localEulerAngles.x);
        print(transform.localEulerAngles.y);
        print(transform.localEulerAngles.z);
    }
}

Unity automatically converts the angles to and from the rotation stored in Transform.localRotation.

Unity从存储在transform.localrotation的旋转自动转换角度。

Transform

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