public static Bounds GetBounds(UIWidget w) { //4个角坐标 Vector3[] corners = w.localCorners; Bounds b = new Bounds(); b.center = Vector3.Lerp(corners[0], corners[2], 0.5f); b.size = corners[2] - corners[0]; return b; }