A class in Root.Township, the global namespace.
A pooled object that releases itself back to its pool a set time after it is requested. Used for short-lived effects.
Constructors
| Member | What it is |
|---|
DestroyByTime() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
2 private and internal fields
| Member | What it is |
|---|
private AltaCoroutine destroyCoroutine | The running countdown, restarted each time the object is taken from the pool. |
private float time | Backing field for Time: seconds until release. |
Properties
| Member | What it is |
|---|
float Time { get; set; } | Seconds before release. Setting it restarts the timer. |
Methods
| Member | What it is |
|---|
override void Release() | Returns the object to the pool if not already released. |
override void ResetRun() | Resets the object and restarts the timer. |
protected virtual void Awake() | Starts the timer each time the object is taken from the pool. |
protected virtual IEnumerator Destroy() (iterator) | Coroutine that waits Time seconds then releases the object. |
protected void StartRuning(PooledObject pooledObject) | Restarts the release timer. |