Skip to main content

ForestPopulationArea

A class in Root.Township, Alta.Forests.

Server: gives a population spawn points along a forest's paths in the chunk it is added to.

Constructors​

MemberWhat it is
ForestPopulationArea()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

5 private and internal fields
MemberWhat it is
private LocationChunk chunkThe chunk the points must fall in.
private IEnumerable<Edge> edgesForest edges in the chunk.
private EdgeType edgeTypeEdge types points can be placed on.
private ForestGenerator forestUnused.
private LayerMask groundLayersLayers the ground raycast hits.

Methods​

MemberWhat it is
override void InitializeAsServer(SpawnData spawnData)Server: waits to be added to a chunk to collect its edges.
2 private and internal methods
MemberWhat it is
private void GetForest(Chunk chunk)When added to a chunk, collects the forest edges in that chunk.
private PointNormal? Alta.Populations.IPointNormalEvaluator.GetPoint()Picks a random point along a matching edge (weighted by length), raycasts down to the ground and returns it, or null.