Unity锚点(Anchor)

发布时间 2023-04-15 23:06:40作者: dewxin

如果一个RectTransform的parent也是RectTransform,那么孩子RectTransform可以通过各种方式锚定在父RectTransform。

Anchor Min 对应左下角的锚点,Anchor Max对应右上角的锚点。

此时显示了PosX PosY字段是因为4个锚点重合,如果锚点不重合,那么可能显示Left Right,代表到左边锚点和右边锚点的距离。

When the anchors are separated the fields can change partially or completely to Left, Right, Top, and Bottom. These fields define the padding inside the rectangle defined by the anchors. The Left and Right fields are used if the anchors are separated horizontally and the Top and Bottom fields are used if they’re separated vertically.