예제 #1
0
        public void DrawSelection(ApartmentBuilderGrid grid, Color color)
        {
            var position = GetVector2Position();

            Handles.color = color;
            WindowObjectDrawer.DrawCircle(position);

            WindowObjectDrawer.DrawLabel(position, position.RoundCoordsToInt().ToString());
        }
예제 #2
0
 private void DrawWallObjects()
 {
     foreach (Room room in _Rooms)
     {
         var wallObjects = room.WallObjects;
         if (wallObjects.Count > 0)
         {
             for (int i = 0, count = room.WallObjects.Count; i < count; i++)
             {
                 wallObjects[i].Object.DrawOnWall(wallObjects[i].GetVector2Position());
                 if (room.IsShowPositions)
                 {
                     var position = wallObjects[i].GetVector2Position();
                     WindowObjectDrawer.DrawLabel(position, position.RoundCoordsToInt().ToString());
                 }
             }
         }
     }
 }
예제 #3
0
        public void Draw(bool isClosed = true)
        {
            var color = MaterialPreset.Color;

            for (int i = 0, count = _Contour.Count; i < (isClosed ? count : count - 1); i++)
            {
                var p1 = _Contour[i].Position;
                var p2 = _Contour[(i + 1) % count].Position;

                Handles.color = color;

                WindowObjectDrawer.DrawLine(p1, p2);

                _Contour[i].Draw();

                if (IsShowSizes)
                {
                    WindowObjectDrawer.DrawLabel(
                        (p1 + p2) / 2,
                        Vector2.Distance(p1, p2).ToString());
                }
                if (IsShowPositions)
                {
                    WindowObjectDrawer.DrawLabel(p1, p1.RoundCoordsToInt().ToString());
                }
            }
            if (WallThickness > 0)
            {
                var contour = GetContourWithThickness();
                for (int i = 0, count = contour.Count; i < contour.Count; i++)
                {
                    Handles.color = new Color(color.r, color.g, color.b, 0.5f);
                    Vector2 p1 = contour[i], p2 = contour[(i + 1) % count];
                    WindowObjectDrawer.DrawLine(_Contour[(i + 1) % _Contour.Count].Position, p1);
                    WindowObjectDrawer.DrawLine(p1, p2);
                }
            }

            if (IsShowSquare)
            {
                WindowObjectDrawer.DrawLabel(Centroid, Square.ToString());;
            }
        }
 protected void DrawMouseLabel(Vector2 position)
 {
     WindowObjectDrawer.DrawLabel(_ParentWindow.Grid.GUIToGrid(position) + MouseLabelOffset, _ParentWindow.Grid.GUIToGrid(position).ToString());
 }