Unity_API翻译_Transform

Transform
class in UnityEngine/inherits from:Component inherits from 继承自
Description 描述
Position,Rotation and Scale of an object,--位置,旋转,缩放的物体
Every object in a scene has a tranform,It is used to store and manipulate (控制) the position,rotatiaon and scale of the object.Every Transform can have a parent,which allows you to apply to position,rotation and scale hierarchically.This is the hierarchy seen in the Hierarchy(层级) pane. They also support enumerators(枚举) so yon can loop through children using

properity 属性
1 Transform.childCount return children object number
the number of children the tranform has

2 Transform.eulerangle return Vector3
The rotation as euler angles in degress 用欧拉角表示一个旋转
The x,y,and z representa rotation z degress around the z axis, x degress around the x axis,and y degressaround the y axis( in that order)
x的旋转表示绕着x轴旋转的度数,以此规律分别表示各个轴的旋转度数

Do not set one of the eulerAngle axis since this will lead to drift and undesired rotation. when seting them to a new value set them all at once as shown above. Unity will convert the angles to and from the rotation stored in Transform.rotation
不能对欧拉角中的某一个值进行赋值,否则那样会导致漂移或者一个不被期望的旋转,当需要对他们进行赋值需要同时进行赋值就像上面那样,unity将会变换角度并且会把这个角度保存到rotation中

3 Transform.forward return vector3
Description
The blue axis of the transform in world space.
变换组件在世界空间中的蓝色轴部分为前方

Manipulate a GameObject’s position on the Z axis (blue axis) of the transform in world space. Unlike Vector3.forward, Transform.forward moves the GameObject while also considering its rotation.When a GameObject is rotated, the blue arrow representing the Z axis of the GameObject also changes direction. Transform.forward moves the GameObject in the blue arrow’s axis (Z).
For moving the GameObject on the Z axis while ignoring rotation, see  Vector3.forward .

控制物体在世界空间中的z轴的位置,而不是Vector3中的前方,移动这个游戏物体同时需要考虑游戏物体的旋转.当游戏物体有旋转,蓝色箭头表示游戏物体的z轴方向也会发生变化。在一个变换组件的前方移动游戏物体表示蓝色箭头部分的轴向。在z轴方向移动物体而忽略游戏物体的旋转,可以参考vercotr3.forward

4 Transform.hasChanged
public bool hasChanged;
Description
Has the transform changed since the last time the flag was set to 'false'?
从上次标签设置为false后,变化组件是否有发生变化
A change to the transform can be anything that can cause its matrix to be recalculated : any adjustment to its position, rotation or scale. Note that operations which can change the transform will not actually check if the old and new value are different before setting this flag. So setting, for instance, transform.position will always set hasChanged on the transform, regardless of there being any actual change.
transform发生任何改变就会引起他的矩阵重新计算(重新调整他的位置,旋转,缩放),需要注意的是改变transform变化的操作实际不会检测新旧值的不同的在设置标签之前,所以设置实例transform的位置总是会发生变化,不管发生任何实际的变化

5 Transform.hierarchyCapacity
public int hierarchyCapacity;
Description
The transform capacity of the transform's hierarchy data structure.
返回transform层级属性面板上transform数据结构的个数(包含此对象的所有节点上的)

Unity internally represents each transform hierarchy, i.e. a root and all it's deep children, with its own packed data structure. This data structure is resized when the number of transforms in it exceeds its capacity.
unity内部会重新绘制每个transform层级面板,包括他们同一个根节点下的所以子节点,用他们自己的数据结构来包装。这个数据结构会重新计算当transform的数量超过他们的容量









猜你喜欢

转载自blog.csdn.net/weixin_36285892/article/details/79002408
今日推荐