Skip to main content

ToolBasedEffect

A class in Root.Township, the global namespace.

A pooled tool effect that fades a material's _Progress value between a minimum and maximum over a set time. Subclass of ToolBasedEffectBase.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private float animationDurationSeconds the fade takes.
private float maxvalue_Progress value at the hidden end of the fade (default 1).
private float minValue_Progress value at the shown end of the fade.

Methods​

MemberWhat it is
protected override IEnumerator Animate(bool isIn) (iterator)Coroutine that lerps _Progress from max to min when going in, or min to max when going out, then cleans up and releases on the way out.