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()); }
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); }