//gets called first time private void DoFirstGenerationStep(List <mazeCell> activeCells) { mazeCell newCell = CreateCell(RandomCoordinates); newCell.Initialize(CreateRoom(-1)); activeCells.Add(newCell); }
private void CreatePassage(mazeCell cell, mazeCell otherCell, mazeDirection direction) { mazePassage prefab = Random.value < doorProbability ? doorPrefab : passagePrefab; mazePassage passage = Instantiate(prefab) as mazePassage; passage.Initialize(cell, otherCell, direction); passage = Instantiate(prefab) as mazePassage; if (passage is mazeDoor) { otherCell.Initialize(CreateRoom(cell.room.settingsIndex)); } else { otherCell.Initialize(cell.room); } passage.Initialize(otherCell, cell, direction.GetOpposite()); }