Skip to main content

WaterfallEffect

A class in Root.Township, Alta.Forests.

Pooled particle effect at the bottom of a waterfall, sized to the river width and shown only while its chunk is fully loaded.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private ParticleSystem[] systemsParticle systems resized to the waterfall's width.
private float verticalOffsetHeight added to the effect's position, once per particle system.

Methods​

MemberWhat it is
static PooledObject AttachTo(PooledObjectDefinition definition, Waterfall waterfall)Takes an effect from the pool at the waterfall bottom, facing downstream, and sizes its particle shapes to the river width.
void Load(Chunk chunk)Shows the effect. Hooked to the chunk's fully loaded event.
void Unload(Chunk chunk)Hides the effect. Hooked to the chunk's fully unloaded event.