private void OnGUI() { if (_isDisplaying && enabled) { Rect selection = ScreenRect.GetScreenRect(_rectangleStartScreenPosition, _screenPosition); ScreenRect.DrawScreenRect(selection, _fillColor); ScreenRect.DrawScreenRectBorders(selection, _borderColor, _borderThickness); } }
public static void DrawScreenRectBorders(Rect rect, Color color, float thickness) { // Top ScreenRect.DrawScreenRect(new Rect(rect.xMin, rect.yMin, rect.width, thickness), color); // Left ScreenRect.DrawScreenRect(new Rect(rect.xMin, rect.yMin, thickness, rect.height), color); // Right ScreenRect.DrawScreenRect(new Rect(rect.xMax - thickness, rect.yMin, thickness, rect.height), color); // Bottom ScreenRect.DrawScreenRect(new Rect(rect.xMin, rect.yMax - thickness, rect.width, thickness), color); }