World座標系のオブジェクトがUI領域にあるかどうかを知りたい時などに、
RectTransform.GetWorldCorners(Vector3[4])
を使うと、UI(RectTransform)の4頂点を一気にとれる。
もちろん回転していても大丈夫。
void debugDrawMargin(RectTransform _marginRT)
{
Vector3[] corners = new Vector3[4];
_marginRT.GetWorldCorners(corners);
Debug.DrawLine(corners[0], corners[1], Color.yellow);
Debug.DrawLine(corners[1], corners[2], Color.yellow);
Debug.DrawLine(corners[2], corners[3], Color.yellow);
Debug.DrawLine(corners[3], corners[0], Color.yellow);
}