Exemplo n.º 1
0
    //gets called first time
    private void DoFirstGenerationStep(List <mazeCell> activeCells)
    {
        mazeCell newCell = CreateCell(RandomCoordinates);

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