Esempio n. 1
0
    private void DoFirstGenStep(List <DungeonCell> activeCells) //Generates the first cell and room
    {
        DungeonCell cell = CreateCell(RandomCoordinates);

        cell.Initialize(CreateRoom(-1));
        activeCells.Add(cell);
    }
Esempio n. 2
0
    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());
    }