예제 #1
0
    private void CreatePassage(MazeCell cell, MazeCell otherCell, MazeDirection direction)
    {
        MazeCellPassage prefab  = Random.value < doorProbability ? this.DoorPrefab : this.PassagePrefab;
        MazeCellPassage passage = Instantiate(prefab) as MazeCellPassage;

        passage.Initialize(cell, otherCell, direction);
        passage = Instantiate(prefab) as MazeCellPassage;
        passage.Initialize(otherCell, cell, direction.GetOpposite());
    }
예제 #2
0
    private void CreatePassage(MazeCell cell, MazeCell otherCell, MazeDirection direction)
    {
        MazeCellPassage prefab  = direction == MazeDirection.EAST ? this.DoorPrefab : this.PassagePrefab;
        MazeCellPassage passage = Instantiate(prefab) as MazeCellPassage;

        passage.Initialize(cell, otherCell, direction);
    }