:crying:
unknown
csharp
a year ago
5.0 kB
11
Indexable
private void CreateCoridors(int offSetX, int offSetY, BiomeRegion region){
if(GetWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 6,offSetY + _roomHeight - 1 - _roomHeight / 2 + 1))){ //LEFT
RemoveWallIfExists(new Vector3Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 4,offSetY + _roomHeight - 1 - _roomHeight / 2 , (int)-0.5));
RemoveWallIfExists(new Vector3Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 6,offSetY + _roomHeight - 1 - _roomHeight / 2 , (int)-0.5));
PlaceWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 5,offSetY + _roomHeight - 1 - _roomHeight / 2 + 1),region);
PlaceWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 5,offSetY + _roomHeight - 1 - _roomHeight / 2 - 1),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 4,offSetY + _roomHeight - 1 - _roomHeight / 2 ),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 5,offSetY + _roomHeight - 1 - _roomHeight / 2 ),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 6,offSetY + _roomHeight - 1 - _roomHeight / 2 ),region);
}
if(GetWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 6,offSetY + _roomHeight - 1 - _roomHeight / 2 + 1))){ //RIGHT
RemoveWallIfExists(new Vector3Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 4,offSetY + _roomHeight - 1 - _roomHeight / 2 , (int)-0.5));
RemoveWallIfExists(new Vector3Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 6,offSetY + _roomHeight - 1 - _roomHeight / 2 , (int)-0.5));
PlaceWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 5,offSetY + _roomHeight - 1 - _roomHeight / 2 + 1),region);
PlaceWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 5,offSetY + _roomHeight - 1 - _roomHeight / 2 - 1),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 4,offSetY + _roomHeight - 1 - _roomHeight / 2 ),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 5,offSetY + _roomHeight - 1 - _roomHeight / 2 ),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 6,offSetY + _roomHeight - 1 - _roomHeight / 2 ),region);
}
if(GetWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 1,offSetY + _roomHeight - 1 - _roomHeight / 2 + 6 ))){ //UP
RemoveWallIfExists(new Vector3Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 + 4 , (int)-0.5));
RemoveWallIfExists(new Vector3Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 + 6 , (int)-0.5));
PlaceWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 1,offSetY + _roomHeight - 1 - _roomHeight / 2 + 5),region);
PlaceWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 1,offSetY + _roomHeight - 1 - _roomHeight / 2 + 5),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 + 4),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 + 5),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 + 6),region);
}
if(GetWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 1,offSetY + _roomHeight - 1 - _roomHeight / 2 - 6 ))){ //DOWN
RemoveWallIfExists(new Vector3Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 - 4 , (int)-0.5));
RemoveWallIfExists(new Vector3Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 - 6 , (int)-0.5));
PlaceWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 + 1,offSetY + _roomHeight - 1 - _roomHeight / 2 - 5),region);
PlaceWallAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2 - 1,offSetY + _roomHeight - 1 - _roomHeight / 2 - 5),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 - 4),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 - 5),region);
PlaceTileAtPosition(new Vector2Int(offSetX + _roomWidth - 1 - _roomWidth / 2,offSetY + _roomHeight - 1 - _roomHeight / 2 - 6),region);
}
}Editor is loading...
Leave a Comment