Skip to main content

TerrainSpline

A class in Root.Township, the global namespace.

Generation part for forest node map edges: builds a Bezier spline along part of the edge, laid on the terrain, and instantiates a prefab on it.

Constructors​

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

Fields​

MemberWhat it is
protected float edgeLengthPercentMaximumLargest share of half the edge length the spline reaches each side.
protected float edgeLengthPercentMinimumSmallest share of half the edge length the spline reaches each side.
protected ObjectPipeline prefabPipeline that picks the prefab placed on the spline.

Properties​

MemberWhat it is
protected Vector3 CustomOffset { get; set; }Extra offset added to the spline's start, for subclasses.

Methods​

MemberWhat it is
override void GenerateStatic(GenerationCore core, bool isModifyingTerrain)With forest node map spawn data, makes a random-length spline along the edge and instantiates the chosen prefab under it.