public static void DrawLine(Vector3 pos0, Vector3 pos1, RectTransform rectTrans, float thickness)
{
// drawLine
float dist = Vector3.Distance(pos0, pos1);
rectTrans.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, dist);
rectTrans.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, thickness);
rectTrans.pivot = new Vector2(0, 0.5f); // update pivot
Vector3 dir = pos1 - pos0;
float angle = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
rectTrans.eulerAngles = new Vector3(0,0, angle);
rectTrans.anchoredPosition = pos0;
}