PopulationPath
A class in Root.Township, the global namespace.
Server: a path edge that spawns and keeps a population of creatures along it, using a PopulationSetup picked at generation. Saves its timer and count.
- Listed in Global namespace: P
- Inherits or implements
BasicDynamicPath,IPopulationFolder,IPointNormalEvaluator,ISavable<PopulationPathSaveData>,ISavableSave<PopulationPathSaveData>,ISavableSaveBase - Derived types
PopulationPathSaveData
Constructors
| Member | What it is |
|---|---|
PopulationPath() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|---|
private float densityMultiplier | Scales how many creatures the path holds. |
private int? loadPopulation | Population count from the save, used once when the path next joins a chunk. |
private TimeSpan? loadTime | Timer value from the save, used once when the path next joins a chunk. |
private ObjectPipeline population | Pipeline that picks the PopulationSetup at generation. |
private float widthMultiplier | Scales how far from the path's center line spawn points can be (0 to 1.5). |
Properties
| Member | What it is |
|---|---|
float AccumulatedTime { get; set; } | Spawn time built up by the population. Saved. |
PopulationSetup Definition { get; private set; } | The population setup in use, chosen from the pipeline on first generation or loaded from the save. |
float DensityMultiplier { get; } | Scales how many creatures the path holds. |
float EndRadius { get; } | Width of the usable path at its end, after the end node's radius. |
IPopulationManager Manager { get; private set; } | The population manager for this path. |
IPointNormalEvaluator PointEvaluator { get; } | This path, used to pick spawn points. |
BasicPopulation Population { get; private set; } | The population living on this path. |
float SquareMeters { get; } | Rough area of the path between the two end nodes. |
float StartRadius { get; } | Width of the usable path at its start, after the start node's radius. |
Methods
| Member | What it is |
|---|---|
PointNormal? GetPoint() | A random spawn point on the terrain inside the path's area, with the ground normal. |
override void InitializeAsServer(SpawnData spawnData) | Picks the population setup and starts the population once the entity is in a chunk. |