Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Transform.localEulerAngles 自身欧拉角
# [Transform](Transform.html).localEulerAngles 自身欧拉角 var *localEulerAngles * : [Vector3](../Vector3/Vector3.html) *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](Transform.Rotate.html) instead. 仅使用者这个变量读取和设置角度到绝对值。不要递增它们,当超过角度 360 度,它将失败。使用 [Transform.Rotate](Transform.Rotate.html) 替代。 * [C#](#) * [JavaScript](#) ``` using UnityEngine; using System.Collections; public class example : MonoBehaviour { public void Awake() { print(transform.localEulerAngles.x); print(transform.localEulerAngles.y); print(transform.localEulerAngles.z); } } ``` ``` // Print the rotation around the parent's X Axis //打印绕父级的X轴的旋转角度 print (transform.localEulerAngles.x); // Print the rotation around the parent's Y Axis //打印绕父级的Y轴的旋转角度 print (transform.localEulerAngles.y); // Print the rotation around the parent's Z Axis //打印绕父级的Z轴的旋转角度 print (transform.localEulerAngles.z); ``` Unity automatically converts the angles to and from the rotation stored in [Transform.localRotation](Transform.localRotation.html) Unity 会从 [Transform.localRotation](Transform.localRotation.html) 这个四元组结构中转换角度到欧拉角的表达方式,或者反过来。
da
2022年5月23日 14:49
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码