示例#1
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);
    }
示例#2
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());
    }