Loading...
Searching...
No Matches
CityBuilderCore.TilemapSpawner Class Reference

Detailed Description

spawns instances of a prefab up to a maximum number
spawn position is randomly selected either from all tiles or just one specific tile on a tilemap
tile positions are selected at the start for performance reasons so changing the tilemap at runtime wont have an effect on the spawner

https://citybuilder.softleitner.com/manual

Inheritance diagram for CityBuilderCore.TilemapSpawner:
CityBuilderCore.ExtraDataBehaviour CityBuilderCore.KeyedBehaviour CityBuilderCore.ISaveData CityBuilderCore.IKeyed

Classes

class  StructureSpawnerData
 
class  StructureSpawnerInstanceData
 

Public Member Functions

override string SaveData ()
 serializes the objects state(usually to json) and returns it
 
override void LoadData (string json)
 deserializes the serialized json data and loads the data as its new state
 
- Public Member Functions inherited from CityBuilderCore.ExtraDataBehaviour
void LoadData (string json)
 deserializes the serialized json data and loads the data as its new state
 
string SaveData ()
 serializes the objects state(usually to json) and returns it
 

Public Attributes

TileBase Tile
 
int Maximum
 
float Interval
 
GameObject Prefab
 
- Public Attributes inherited from CityBuilderCore.KeyedBehaviour
string Key
 

Additional Inherited Members

- Properties inherited from CityBuilderCore.IKeyed

Member Function Documentation

◆ LoadData()

override void CityBuilderCore.TilemapSpawner.LoadData ( string json)
inline

deserializes the serialized json data and loads the data as its new state

Parameters
json

Implements CityBuilderCore.ISaveData.

◆ SaveData()

override string CityBuilderCore.TilemapSpawner.SaveData ( )
inline

serializes the objects state(usually to json) and returns it

Returns
serialized save data

Implements CityBuilderCore.ISaveData.