Responsible for spawning buildings on available map tiles, based on weighted probability and placement rules.
More...
|
| BuildingSpawner (Terrain terrain, int tileSize, int mapWidthInTiles, int mapLengthInTiles, int wallsMargin) |
| Initializes a new instance of the BuildingSpawner class.
|
|
List< GameObject > | SpawnBuildings (Tile[,] tiles, List< Tile > allTiles, List< BuildingSetup > buildings) |
| Attempts to spawn buildings on the map based on tile availability and weighted prefab selection.
|
|
Responsible for spawning buildings on available map tiles, based on weighted probability and placement rules.
◆ BuildingSpawner()
BuildingSpawner.BuildingSpawner |
( |
Terrain |
terrain, |
|
|
int |
tileSize, |
|
|
int |
mapWidthInTiles, |
|
|
int |
mapLengthInTiles, |
|
|
int |
wallsMargin |
|
) |
| |
Initializes a new instance of the BuildingSpawner class.
- Parameters
-
terrain | Terrain used for height sampling. |
tileSize | Size of a tile in world units. |
mapWidthInTiles | Total map width in tiles. |
mapLengthInTiles | Total map length in tiles. |
wallsMargin | Minimum number of tiles to leave empty near the map edge. |
◆ SpawnBuildings()
List< GameObject > BuildingSpawner.SpawnBuildings |
( |
Tile |
tiles[,], |
|
|
List< Tile > |
allTiles, |
|
|
List< BuildingSetup > |
buildings |
|
) |
| |
Attempts to spawn buildings on the map based on tile availability and weighted prefab selection.
- Parameters
-
tiles | 2D grid of map tiles. |
allTiles | Flat list of all tiles for randomization. |
buildings | List of building prefabs and their configuration. |
- Returns
- List of spawned building GameObjects.
The documentation for this class was generated from the following file: