获取Posx,Posx,通过anchoredPosition
GetComponent<RectTransform>().anchoredPosition.x;
获取Width Height,通过 sizeDelta
gameObject.GetComponent<RectTransform>().sizeDelta.y;
获取Top
GetComponent<RectTransform> ().offsetMax
(transform as RectTransform).offsetMin
//两种方法都可以
获取Bottom
GetComponent<RectTransform> ().offsetMin