private void DoFirstGenStep(List <DungeonCell> activeCells) //Generates the first cell and room { DungeonCell cell = CreateCell(RandomCoordinates); cell.Initialize(CreateRoom(-1)); activeCells.Add(cell); }
private void CreatePassage(DungeonCell cell, DungeonCell otherCell, DungeonDirection direction) //Creates a passage between cells { DungeonPassage prefab = Random.value < doorProbability ? doorPrefab : passagePrefab; DungeonPassage passage = Instantiate(prefab) as DungeonPassage; passage.Initialize(cell, otherCell, direction); if (passage is DungeonDoor) { otherCell.Initialize(CreateRoom(cell.room.settingIndex)); } else { otherCell.Initialize(cell.room); } passage = Instantiate(prefab) as DungeonPassage; passage.Initialize(otherCell, cell, direction.GetOpposite()); }