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
| Member | What it is |
|---|
PooledLerpFollow() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private bool isSettingTargetToParent | Whether to follow the parent transform (default true). |
private PooledObject targetPooledObject | The pooled object whose requests restart the lerp. |
Methods
| Member | What it is |
|---|
void StopLerp() | Stops following and disables the component. |
3 private and internal methods
| Member | What 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. |