예제 #1
0
 private void DrawDimensions()
 {
     Handles.color = SkinManager.Instance.CurrentSkin.RoomDimensionsColor;
     for (int i = 0; i < _DimensionsPoints.Length; i++)
     {
         WindowObjectDrawer.DrawLine(_DimensionsPoints[i], _DimensionsPoints[(i + 1) % _DimensionsPoints.Length]);
     }
 }
예제 #2
0
        public void DrawSelection(ApartmentBuilderGrid grid, Color color)
        {
            var position = GetVector2Position();

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

            WindowObjectDrawer.DrawLabel(position, position.RoundCoordsToInt().ToString());
        }
예제 #3
0
        public void DrawSelection(ApartmentBuilderGrid grid, Color color)
        {
            Handles.color = color;
            for (int i = 0, count = _Contour.Count; i < count; i++)
            {
                var p1 = _Contour[i].Position;
                var p2 = _Contour[(i + 1) % count].Position;

                Handles.color = color;
                WindowObjectDrawer.DrawLine(p1, p2);
            }
        }
예제 #4
0
        public void DrawOnWall(Vector2 position)
        {
            var apartment = ApartmentsManager.Instance.CurrentApartment;
            var room      = apartment.GetNearestRoom(position);

            if (room != null)
            {
                var projection = room.GetNearestPointOnContour(position);
                Handles.color = SkinManager.Instance.CurrentSkin.VertColor;

                WindowObjectDrawer.DrawCircle(projection.Value);
            }
        }
예제 #5
0
        public void DrawOnWall(Vector2 position)
        {
            var apartment = ApartmentsManager.Instance.CurrentApartment;
            var room      = apartment.GetNearestRoom(position);

            if (room != null)
            {
                Vector2 tangent;
                var     projection = room.GetNearestPointOnContour(position, out tangent);
                Handles.color = this is Door ? SkinManager.Instance.CurrentSkin.DoorColor : SkinManager.Instance.CurrentSkin.WindowColor;

                WindowObjectDrawer.DrawCircle(projection.Value);
                WindowObjectDrawer.DrawLine(projection.Value - tangent * Width / 2, projection.Value + tangent * Width / 2);
            }
        }
예제 #6
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());
                 }
             }
         }
     }
 }
예제 #7
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());;
            }
        }
예제 #8
0
        public override void Draw()
        {
            if (!_IsActive)
            {
                return;
            }
            var mousePos = _CurrentMousePosition;

            if (_CurrentRoom != null && _CurrentRoom.Contour.Count > 0)
            {
                Handles.color = Color.gray;
                var contour = _CurrentRoom.Contour;
                WindowObjectDrawer.DrawLine(
                    _ParentWindow.Grid.GUIToGrid(mousePos),
                    contour[contour.Count - 1].Position);
            }

            DrawMouseLabel(mousePos);

            _CurrentRoom.Draw(false);
        }
 protected void DrawMouseLabel(Vector2 position)
 {
     WindowObjectDrawer.DrawLabel(_ParentWindow.Grid.GUIToGrid(position) + MouseLabelOffset, _ParentWindow.Grid.GUIToGrid(position).ToString());
 }
예제 #10
0
 private void DrawPlanImage()
 {
     WindowObjectDrawer.DrawTexture(new Rect(_Dimensions.position, new Vector2(_Dimensions.size.x, -_Dimensions.size.y)), PlanImage);
 }
예제 #11
0
 public void Draw()
 {
     Handles.color = SkinManager.Instance.CurrentSkin.VertColor;
     WindowObjectDrawer.DrawCircle(_Position);
 }