Skip to main content

GeneratablePart

An abstract class in Root.Township, the global namespace.

Base for parts of a GenerationCore (a procedurally placed static piece) that adjust or add to it when it generates, such as aligning to a path or the terrain slope.

Constructors​

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

Methods​

MemberWhat it is
virtual void GenerateDynamic(GenerationCore core)Called after GenerateStatic, only when the spawn data is generating (first time). Use it to make saved, dynamic content.
virtual void GenerateStatic(GenerationCore core, bool isModifyingTerrain)Called every time the piece generates, with whether terrain may be changed. Use it for the parts rebuilt on each load.

Used in​

Members of other types that take, return or hold a GeneratablePart: