Skip to main content

SpawnModifier<T>

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

Base asset for filters in the forest fill spawner that adjust a candidate point and its weight before spawning. Subclasses fix T, for example SpawnModifierPoint.

Constructors​

MemberWhat it is
protected SpawnModifier()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

MemberWhat it is
protected string safeNameThe asset's name, cached in Initialize.

Methods​

MemberWhat it is
abstract void Filter(ForestFillCore.Setup setup, ref T point, ref float weight)Changes the point and its spawn weight for the given fill setup.
virtual void Initialize()Caches the asset name in safeName.