Exemple #1
0
        private void DrawEdge(Edge edge)
        {
            int x, y, width, height;

            if (edge.origin.direction == Directions.Left || edge.origin.direction == Directions.Down)
            {
                x = Translate(edge.exit.x);
                y = Translate(edge.exit.y);
            }
            else
            {
                x = Translate(edge.origin.x);
                y = Translate(edge.origin.y);
            }

            if (edge.origin.direction == Directions.Left || edge.origin.direction == Directions.Right)
            {
                width  = cellSize * 2 + cellWallSize;
                height = cellSize;
            }
            else
            {
                width  = cellSize;
                height = cellSize * 2 + cellWallSize;
            }
            var color = rainbow ? ColorE.HSVToRGB(Mathf.Repeat(edge.origin.depth / 360f, 1), 1, 1) : Color.white;

            texture.DrawRect(x, y, width, height, color);
        }
Exemple #2
0
    private void DrawEdge(Edge edge)
    {
        int x, y, width, height;

        if (edge.origin.direction == Directions.Left || edge.origin.direction == Directions.Down)
        {
            x = Translate(edge.exit.x);
            y = Translate(edge.exit.y);
        }
        else
        {
            x = Translate(edge.origin.x);
            y = Translate(edge.origin.y);
        }

        if (edge.origin.direction == Directions.Left || edge.origin.direction == Directions.Right)
        {
            width  = cellSize * 2 + wallSize;
            height = cellSize;
        }
        else
        {
            width  = cellSize;
            height = cellSize * 2 + wallSize;
        }

        Color color;

        if (useRainbowGradient)
        {
            float hue = Mathf.Repeat(edge.origin.depth / 360f, 1);
            color = ColorE.HSVToRGB(hue, 1, 1);
        }
        else
        {
            color = Color.white;
        }

        for (int i = 0; i < width; i++)
        {
            for (int j = 0; j < height; j++)
            {
                heights[x + i, y + j] = floorHeight;
            }
        }


        texture.DrawRect(x, y, width, height, color);
    }