public static void Circle(int _startAmount, int _middleAmount) { Vector2Int startPoint = new Vector2Int(DungeonUtility.GetBuildPoint().x, DungeonUtility.GetBuildPoint().y); List <Vector2Int> CirclePoints = new List <Vector2Int>(); CircleRightSide(CirclePoints, _startAmount, startPoint, _middleAmount); CircleLeftSide(CirclePoints, startPoint, _middleAmount); }
public static void Square() { for (int i = 0; i < WallGen.GetWallDimensions().x + 1; ++i) { for (int a = 0; a < WallGen.GetWallDimensions().y; ++a) { Vector2Int pos = new Vector2Int(DungeonUtility.GetBuildPoint().x + i, DungeonUtility.GetBuildPoint().y + a); AddToFloorTilePositions(pos); } } }
public static void TShape(int _stemWidth, int _stemHeight, int _roomLength, int _roomHeight, int _directionIndex) { for (int i = 0; i < _stemWidth + 1; ++i) { for (int a = 0; a < _stemHeight; ++a) { Vector2Int pos = new Vector2Int(DungeonUtility.GetBuildPoint().x + i, DungeonUtility.GetBuildPoint().y + a); AddToFloorTilePositions(pos); } } for (int i = 0; i < _roomLength + 1; ++i) { for (int a = 0; a < _roomHeight; ++a) { switch (_directionIndex) { case 0: //Right Vector2Int pos = ShapeDirectionVector(_stemWidth + i, ((_stemHeight - _roomHeight) / 2) + a); AddToFloorTilePositions(pos); break; case 1: //Left Vector2Int pos2 = ShapeDirectionVector((_stemWidth - _roomHeight) / 2 - i, ((_stemHeight - _roomHeight) / 2) + a); AddToFloorTilePositions(pos2); break; case 2: //Up Vector2Int pos3 = ShapeDirectionVector(_stemWidth / 2 - i, _stemHeight + a); Vector2Int pos3a = ShapeDirectionVector(_stemWidth / 2 + i, _stemHeight + a); AddToFloorTilePositions(pos3); AddToFloorTilePositions(pos3a); break; case 3: //Down Vector2Int pos4 = ShapeDirectionVector(_stemWidth / 2 - i, a); Vector2Int pos4a = ShapeDirectionVector(_stemWidth / 2 + i, a); AddToFloorTilePositions(pos4); AddToFloorTilePositions(pos4a); break; } } } }
static Vector2Int ShapeDirectionVector(int _roomLength, int _roomHeight) { Vector2Int pos = new Vector2Int(DungeonUtility.GetBuildPoint().x + _roomLength, DungeonUtility.GetBuildPoint().y + _roomHeight); return(pos); }