private void CreatePassageInSameRoom(LevelCell cell, LevelCell otherCell, LevelDirection direction, Canvas twoDMap) { LevelPassage passage = Instantiate(passagePrefab) as LevelPassage; passage.Initialize(cell, otherCell, direction); passage = Instantiate(passagePrefab) as LevelPassage; passage.Initialize(otherCell, cell, direction.GetOpposite()); if (cell.room != otherCell.room) { LevelRoom joinRoom = otherCell.room; cell.room.Join(joinRoom); rooms.Remove(joinRoom); Destroy(joinRoom); } CreateTwoDPassage(cell, twoDMap, direction); }
private void CreatePassage(LevelCell cell, LevelCell otherCell, LevelDirection direction, Canvas twoDMap, bool existingCell) { LevelPassage passage = Instantiate(passagePrefab) as LevelPassage; passage.Initialize(cell, otherCell, direction); passage = Instantiate(passagePrefab) as LevelPassage; if (!existingCell) { if (Random.value < newRoomProbability) { otherCell.InitializeCell(CreateRoom(cell.room.matIndex)); } else { otherCell.InitializeCell(cell.room); } CreateTwoDCell(otherCell, twoDMap); } passage.Initialize(otherCell, cell, direction.GetOpposite()); CreateTwoDPassage(cell, twoDMap, direction); }