RectTransform
pivot
The normalized position in this RectTransform that it rotates around.
理解:矩形的中心点,归一化坐标(相当于自身矩形长宽比例的坐标)
例如,(0,0)表示矩形的左下角,(1,1)为右上角
rect
The calculated rectangle in the local space of the
Transform
.
Transform
的本地空间中计算的矩形
理解
// rect : UnityEngine.Rect
// x,y:自身矩形左下角相对Pivot点的坐标,即以RectTransform的pivot点为原点的坐标系中,左下角的坐标
// width,height:矩形宽度和高度
rect只跟自身中心点pivot位置和自身长宽有关,与本身在父节点中的位置无关
表示的是相对中心点的矩形位置和大小
所以不能通过修改rect达到移动位置的目的
anchors
理解:anchors为锚定到父节点上的矩形的两个点,左下角和右上角
这两个点是在父节点RectTransform中的归一化坐标,可以超出父节点大小
anchorMin
The normalized position in the parent RectTransform that the lower left corner is anchored to.
理解:左下角在父节点RectTransform中的归一化坐标(0~1)
anchorMax
The normalized position in the parent RectTransform that the upper right corner is anchored t