Ejemplo n.º 1
0
    void GenerateHall(RectI prevRoom, RectI curRoom, List <LineI> halls)
    {
        var rand1  = prevRoom.GetRandPoint();
        var rand2  = curRoom.GetRandPoint();
        var corner = new Vector2(rand1.x, rand2.y);

        if (Random.Range(0, 100) > 50)
        {
            corner = new Vector2(rand2.x, rand1.y);
        }

        halls.Add(new LineI(rand1, corner));
        halls.Add(new LineI(corner, rand2));
    }