update
This commit is contained in:
@@ -25,6 +25,7 @@ namespace Hallucinate.GameSetup.Maze
|
||||
|
||||
private void GenerateRecursive(MazeGrid grid, int x, int z)
|
||||
{
|
||||
if (grid.GetCell(x, z) != MazeCellType.Wall) return;
|
||||
if (grid.CountSquareNeighbours(x, z, MazeCellType.Corridor) >= DeadEndNeighbourThreshold) return;
|
||||
|
||||
grid.SetCell(x, z, MazeCellType.Corridor);
|
||||
@@ -45,6 +46,7 @@ namespace Hallucinate.GameSetup.Maze
|
||||
|
||||
private IEnumerator GenerateRecursiveStepByStep(MazeGrid grid, int x, int z, int cellsPerFrame)
|
||||
{
|
||||
if (grid.GetCell(x, z) != MazeCellType.Wall) yield break;
|
||||
if (grid.CountSquareNeighbours(x, z, MazeCellType.Corridor) >= DeadEndNeighbourThreshold) yield break;
|
||||
|
||||
grid.SetCell(x, z, MazeCellType.Processing);
|
||||
|
||||
Reference in New Issue
Block a user