Responsible for placing decorative elements (e.g. trees, rocks) on available tiles in the terrain.
More...
Responsible for placing decorative elements (e.g. trees, rocks) on available tiles in the terrain.
◆ DecorationSpawner()
DecorationSpawner.DecorationSpawner |
( |
Terrain |
terrain, |
|
|
int |
tileSize |
|
) |
| |
Initializes a new instance of the DecorationSpawner class.
- Parameters
-
terrain | Reference to the terrain object for height placement. |
tileSize | Size of a single tile in world units. |
◆ SpawnDecorations()
int DecorationSpawner.SpawnDecorations |
( |
Tile |
tiles[,], |
|
|
List< Tile > |
allTiles, |
|
|
List< BuildingSetup > |
decorations |
|
) |
| |
Spawns decorative objects randomly on unoccupied tiles.
- Parameters
-
tiles | 2D grid of map tiles. |
allTiles | Flat list of all tiles for random sampling. |
decorations | List of decoration prefabs with weight configuration. |
- Returns
- Total number of decorations placed.
The documentation for this class was generated from the following file: