Example #1
0
        private void DrawBounds()
        {
            var bounds       = _building.Bounds;
            var roofPosition = new Vector2(bounds.center.x, bounds.yMax - _building.RoofHeight);
            var size         = HandleUtility.GetHandleSize(bounds.center) * 0.1f;

            HandleHelper.DrawLine(new Vector2(bounds.xMin, roofPosition.y), new Vector2(bounds.xMax, roofPosition.y), Color.cyan);

            var selectedBounds       = HandleHelper.BoundsHandle(bounds, new Vector2(0.5f, 0.5f), Color.blue, Color.clear, Color.white, Color.white);
            var selectedRoofPosition = HandleHelper.MoveHandle(roofPosition, new Vector2(size * 2.5f, size), Vector2.one, Color.cyan, Color.cyan);

            UpdateMainTransforms(selectedBounds, _building.SortPoint, bounds.yMax - selectedRoofPosition.y, true);
        }