矩形的位置、大小、锚点和轴心信息。
RectTransforms 用于 GUI,不过也可以用于其他情况。
它用于存储和操作矩形的位置、大小和锚定,并支持各种形式的缩放(基于父 RectTransform)。
注意:Inspector 基于在使用哪个锚点预设对公开哪些属性进行更改。有关更多信息,请参阅矩形变换和基本布局。
| anchoredPosition | 此 RectTransform 的轴心相对于锚点参考点的位置。 |
| anchoredPosition3D | 此 RectTransform 的轴心相对于锚点参考点的 3D 位置。 |
| anchorMax | 父 RectTransform 中右上角锚定到的标准化位置。 |
| anchorMin | 父 RectTransform 中左下角锚定到的标准化位置。 |
| drivenByObject | 驱动此 RectTransform 的值的对象。如果未驱动,则值为 null。 |
| offsetMax | 矩形右上角相对于右上锚点的偏移。 |
| offsetMin | 矩形左下角相对于左下锚点的偏移。 |
| pivot | 此 RectTransform 中围绕其旋转的标准化位置。 |
| rect | Transform 的本地空间中计算的矩形。 |
| sizeDelta | 此 RectTransform 相对于锚点之间距离的大小。 |
| ForceUpdateRectTransforms | 强制重新计算 RectTransform 内部数据。 |
| GetLocalCorners | 获取计算的矩形在其 Transform 的本地空间中的各个角。 |
| GetWorldCorners | 获取计算的矩形在世界空间中的各个角。 |
| SetInsetAndSizeFromParentEdge | 设置此矩形相对于父矩形指定边缘的距离,同时也会设置其大小。 |
| SetSizeWithCurrentAnchors | 使 RectTransform 计算的矩形在指定轴上具有给定大小。 |
| reapplyDrivenProperties | 为需要重新应用其驱动属性的 RectTransform 调用的事件。 |
| ReapplyDrivenProperties | 用于 reapplyDrivenProperties 事件的委托。 |
| gameObject | 此组件附加到的游戏对象。始终将组件附加到游戏对象。 |
| tag | 此游戏对象的标签。 |
| transform | 附加到此 GameObject 的 Transform。 |
| hideFlags | 该对象应该隐藏、随场景一起保存还是由用户修改? |
| name | 对象的名称。 |
| childCount | 父变换具有的子项数。 |
| eulerAngles | 以欧拉角表示的旋转(以度为单位)。 |
| forward | 返回一个标准化矢量,它表示世界空间中变换的蓝轴。 |
| hasChanged | 自上次将标志设置为“false”以来,变换是否发生更改? |
| hierarchyCapacity | 变换的层级视图数据结构的变换容量。 |
| hierarchyCount | 变换的层级视图数据结构中变换的数量。 |
| localEulerAngles | 以欧拉角表示的相对于父变换旋转的旋转(以度为单位)。 |
| localPosition | 相对于父变换的变换位置。 |
| localRotation | 相对于父级变换旋转的变换旋转。 |
| localScale | 相对于 GameObjects 父对象的变换缩放。 |
| localToWorldMatrix | 将点从本地空间转换到世界空间的矩阵(只读)。 |
| lossyScale | 对象的全局缩放。(只读) |
| parent | 变换的父级。 |
| position | 世界空间中的变换位置。 |
| right | 世界空间中变换的红轴。 |
| root | 返回层级视图中最顶层的变换。 |
| rotation | 一个 Quaternion,用于存储变换在世界空间中的旋转。 |
| up | 世界空间中变换的绿轴。 |
| worldToLocalMatrix | 将点从世界空间转换到本地空间的矩阵(只读)。 |
| BroadcastMessage | 调用此游戏对象或其任何子项中的每个 MonoBehaviour 上名为 methodName 的方法。 |
| CompareTag | Checks the GameObject's tag against the defined tag. |
| GetComponent | Gets a reference to a component of type T on the same GameObject as the component specified. |
| GetComponentInChildren | Gets a reference to a component of type T on the same GameObject as the component specified, or any child of the GameObject. |
| GetComponentInParent | Gets a reference to a component of type T on the same GameObject as the component specified, or any parent of the GameObject. |
| GetComponents | Gets references to all components of type T on the same GameObject as the component specified. |
| GetComponentsInChildren | Gets references to all components of type T on the same GameObject as the component specified, and any child of the GameObject. |
| GetComponentsInParent | Gets references to all components of type T on the same GameObject as the component specified, and any parent of the GameObject. |
| SendMessage | 调用此游戏对象中的每个 MonoBehaviour 上名为 methodName 的方法。 |
| SendMessageUpwards | 调用此游戏对象中的每个 MonoBehaviour 上或此行为的每个父级上名为 methodName 的方法。 |
| TryGetComponent | 获取指定类型的组件(如果存在)。 |
| GetInstanceID | Gets the instance ID of the object. |
| ToString | 返回对象的名称。 |
| DetachChildren | 清除所有子项的父级。 |
| Find | Finds a child by name n and returns it. |
| GetChild | 按索引返回变换子项。 |
| GetLocalPositionAndRotation | Gets the position and rotation of the Transform component in local space (that is, relative to its parent transform). |
| GetPositionAndRotation | Gets the position and rotation of the Transform component in world space. |
| GetSiblingIndex | 获取同级索引。 |
| InverseTransformDirection | Transforms a direction from world space to local space. The opposite of Transform.TransformDirection. |
| InverseTransformDirections | Transforms multiple directions from world space to local space overwriting each original position with the transformed version. The opposite of Transform.TransformDirections. |
| InverseTransformPoint | 将 position 从世界空间变换到本地空间。 |
| InverseTransformPoints | Transforms multiple positions from world space to local space overwriting each original position with the transformed version. |
| InverseTransformVector | Transforms a vector from world space to local space. The opposite of Transform.TransformVector. |
| InverseTransformVectors | Transforms multiple vectors from world space to local space overwriting each original position with the transformed version. The opposite of Transform.TransformVectors. |
| IsChildOf | 该变换是否为 parent 的子项? |
| LookAt | 旋转变换,使向前矢量指向 target 的当前位置。 |
| Rotate | 使用 Transform.Rotate 以各种方式旋转 GameObjects。通常以欧拉角而不是四元数提供旋转。 |
| RotateAround | 将变换围绕穿过世界坐标中的 point 的 axis 旋转 angle 度。 |
| SetAsFirstSibling | 将变换移动到本地变换列表的开头。 |
| SetAsLastSibling | 将变换移动到本地变换列表的末尾。 |
| SetLocalPositionAndRotation | Sets the position and rotation of the Transform component in local space (i.e. relative to its parent transform). |
| SetParent | 设置变换的父级。 |
| SetPositionAndRotation | 设置变换组件的世界空间位置和旋转。 |
| SetSiblingIndex | 设置同级索引。 |
| TransformDirection | 将 direction 从本地空间变换到世界空间。 |
| TransformDirections | Transforms multiple directions from local space to world space overwriting each original direction with the transformed version. |
| TransformPoint | 将 position 从本地空间变换到世界空间。 |
| TransformPoints | Transforms multiple points from local space to world space overwriting each original point with the transformed version. |
| TransformVector | 将 vector 从本地空间变换到世界空间。 |
| TransformVectors | Transforms multiple vectors from local space to world space overwriting each original vector with the transformed version. |
| Translate | 根据 translation 的方向和距离移动变换。 |
| Destroy | 移除 GameObject、组件或资源。 |
| DestroyImmediate | 立即销毁对象 /obj/。强烈建议您改用 Destroy。 |
| DontDestroyOnLoad | 在加载新的 Scene 时,请勿销毁 Object。 |
| FindAnyObjectByType | Retrieves any active loaded object of Type type. |
| FindFirstObjectByType | Retrieves the first active loaded object of Type type. |
| FindObjectOfType | 返回第一个类型为 type 的已加载的激活对象。 |
| FindObjectsByType | Retrieves a list of all loaded objects of Type type. |
| FindObjectsOfType | Gets a list of all loaded objects of Type type. |
| Instantiate | 克隆 original 对象并返回克隆对象。 |
| bool | 该对象是否存在? |
| operator != | 比较两个对象是否引用不同的对象。 |
| operator == | 比较两个对象引用,判断它们是否引用同一个对象。 |