Skip to main content

PooledLerpFollow

A class in Root.Township, the global namespace.

A LerpFollow on a pooled object that restarts each time the object is taken from the pool, by default following its new parent.

Constructors​

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

Fields​

2 private and internal fields
MemberWhat it is
private bool isSettingTargetToParentWhether to follow the parent transform (default true).
private PooledObject targetPooledObjectThe pooled object whose requests restart the lerp.

Methods​

MemberWhat it is
void StopLerp()Stops following and disables the component.
3 private and internal methods
MemberWhat it is
private void Awake()Hooks the pooled object's Requested event.
private void Restart(PooledObject pooledObject)Resets the start position and waits a frame before starting the lerp.
private IEnumerator WaitForSetup() (iterator)Coroutine: at end of frame, sets the target to the parent if wanted and starts the lerp.