Hi everyone. So here’s the problem, I’m trying to make a selection box in the scene view but the lines are not showing up. Here’s my code:
private void DrawSelectionBox(float originX, float originY, float endX, float endY) {
Debug.Log(originX + " " + originY + " " + endX + " " + endY);
Vector3 topLeft = new Vector3(originX, originY, 0f);
Vector3 botLeft = new Vector3(originX, endY, 0f);
Vector3 botRight = new Vector3(endX, endY, 0f);
Vector3 topRight = new Vector3(endX, originY, 0f);
Vector3[] lines = { topLeft, botLeft, botRight, topRight };
int[] indexes = { 0, 1, 1, 2, 2, 3, 3, 0 };
//Handles.DrawLines(lines, indexes);
//Handles.DrawLine(new Vector3(originX, originY, originY), new Vector3(endX, endY, endY));
Handles.DrawSolidRectangleWithOutline(lines, new Color(1, 1, 1, 0.2f), new Color(0, 0, 0, 1));
}
Everything is inside OnSceneGUI and still not showing anything. Please help Thanks in advance!