The green rectangle only show at the Scene window, nothing shows in the Game window
if (isRightMouseDragging && Input.GetMouseButtonUp(1))
{
isRightMouseDragging = false;
}
if (Input.GetMouseButtonDown(1))
{
isRightMouseDragging = true;
selectionVertices[0] = mousePosition;
}
if (isRightMouseDragging && Input.GetMouseButton(1))
{
selectionVertices[1] = new Vector3(mousePosition.x, selectionVertices[0].y, 0);
selectionVertices[2] = mousePosition;
selectionVertices[3] = new Vector3(selectionVertices[0].x, mousePosition.y, 0);
var draw = Draw.ingame;
using (draw.WithLineWidth(borderWidth))
{
draw.Polyline(selectionVertices, true, Color.green);
}
}