Skip to main content

TerrainSplatPart

A class in Root.Township, the global namespace.

Generation part that paints a terrain texture in a circle around it, fading by distance. Skipped on headless servers.

Constructors​

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

Fields​

5 private and internal fields
MemberWhat it is
private bool isLayer1Whether to paint splat layer 1.
private bool isLayer2Whether to paint splat layer 2.
private float radiusRadius of the painted area.
private AnimationCurve strengthPaint strength by distance from the centre.
private int textureIndex of the terrain texture to paint.

Methods​

MemberWhat it is
override void GenerateStatic(GenerationCore core, bool isModifyingTerrain)When allowed to modify terrain (and not headless), sets the texture on the chosen splat layers where it's stronger than what's there.
1 private and internal method
MemberWhat it is
private void OnDrawGizmos()Draws the radius as a red circle.