private void CreatePassageInSameRoom(DungeonCell cell, DungeonCell otherCell, DungeonDirection direction) //Combines rooms into larger rooms
    {
        DungeonPassage passage = Instantiate(passagePrefab) as DungeonPassage;

        passage.Initialize(cell, otherCell, direction);
        passage = Instantiate(passagePrefab) as DungeonPassage;
        passage.Initialize(otherCell, cell, direction.GetOpposite());
        if (cell.room != otherCell.room)
        {
            DungeonRoom roomToCombine = otherCell.room;
            cell.room.Combine(roomToCombine);
            rooms.Remove(roomToCombine);
            Destroy(roomToCombine);
        }
    }
Beispiel #2
0
    private void CreatePassageInSameRoom(Cell cell, Cell otherCell, Direction direction)
    {
        DungeonPassage passage = Instantiate(passagePrefab) as DungeonPassage;

        passage.Initialize(cell, otherCell, direction);
        passage = Instantiate(passagePrefab) as DungeonPassage;
        passage.Initialize(otherCell, cell, direction.GetOpposite());
        if (cell.room != otherCell.room)
        {
            DungeonRoom roomToAssimilate = otherCell.room;
            cell.room.Assimilate(roomToAssimilate);
            rooms.Remove(roomToAssimilate);
            Destroy(roomToAssimilate);
        }
    }
    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());
    }
Beispiel #4
0
    private void CreatePassage(Cell currentCell, Cell neighbor, Direction direction)
    {
        DungeonPassage prefab  = Random.value < doorProbability ? doorPrefab : passagePrefab;
        DungeonPassage passage = Instantiate(prefab) as DungeonPassage;

        passage.Initialize(currentCell, neighbor, direction);
        passage = Instantiate(prefab) as DungeonPassage;
        if (passage is DungeonDoor)
        {
            neighbor.Initialize(CreateRoom(currentCell.room.settingsIndex));
        }
        else
        {
            neighbor.Initialize(currentCell.room);
        }
        passage.Initialize(neighbor, currentCell, direction.GetOpposite());
    }