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]); } }
public void DrawSelection(ApartmentBuilderGrid grid, Color color) { var position = GetVector2Position(); Handles.color = color; WindowObjectDrawer.DrawCircle(position); WindowObjectDrawer.DrawLabel(position, position.RoundCoordsToInt().ToString()); }
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); } }
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); } }
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); } }
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()); } } } } }
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());; } }
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()); }
private void DrawPlanImage() { WindowObjectDrawer.DrawTexture(new Rect(_Dimensions.position, new Vector2(_Dimensions.size.x, -_Dimensions.size.y)), PlanImage); }
public void Draw() { Handles.color = SkinManager.Instance.CurrentSkin.VertColor; WindowObjectDrawer.DrawCircle(_Position); }