Unity_API translation _Transform

Transform
class in UnityEngine/inherits from:Component inherits from 继承自
Description Description
Position, Rotation and Scale of an object, - the position, rotation, scaling the 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 property
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 Euler angles represented by a rotation
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 represents the degree of rotation about the x axis, in order law represent the degree of rotation of the respective shaft

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
Can not one of the values ​​of the Euler angles assignment, otherwise that would result in a drift or undesired rotation when they need to carry out the assignment need to be assigned just like, unity will transform the above point of view and this will save the rotation angle in

3 Transform.forward return vector3
Description
The blue axis of the transform in world space.
Converting the blue component in the shaft portion of the front 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的数量超过他们的容量









Guess you like

Origin blog.csdn.net/weixin_36285892/article/details/79002408