Skip to main content

QuestCompleteEffect

A class in Root.Township, the global namespace.

Pooled popup shown when a quest task is done: shows the task text, scales up with a light, rises, then shrinks and returns to the pool. Client visual.

Constructors​

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

Fields​

10 private and internal fields
MemberWhat it is
private LightFader lightFaderLight turned on during the effect and off as it shrinks.
private TransformEvent onScaleUpEndedEvent fired with the scaled transform when the scale-up ends.
private float progressCurrent animation progress.
private float scaleAnimationDurationSeconds the scale up and scale down each take.
private FloatEvent scaleAnimationProgressEvent given the scale progress each frame.
private Transform scalingTargetTransform that is scaled.
private TextRenderer textText renderer showing the task description.
private float upAnimationDurationSeconds the rise animation takes.
private float upDurationTotal seconds from start of rise to start of shrink.
private FloatEvent upProgressEvent given the rise progress each frame.

Methods​

MemberWhat it is
void SetupTask(string taskDescription)Sets the text shown on the popup.
3 private and internal methods
MemberWhat it is
private void Animate(PooledObject pooledObject)Starts the animation coroutine when the object is taken from the pool.
private IEnumerator Animation() (iterator)Coroutine that scales up, plays the rise, waits, scales down and releases the object.
private void Awake()Hooks the pool's Requested event to start the animation.