|
Eye of the Nile Docs
Everything you need to know to get started!
|
Put this script on any object you want to automatically despawn after a certain amount of time.
Documentation updated 8/23/2024
Public Attributes | |
| float | seconds = 10f |
| Time until object despawns, in seconds. | |
| bool | destroyGameObject = true |
| If true, the object will be destroyed. | |
| UnityEvent | onDespawn |
| Event that's triggered when the despawn timer runs out. A function can be subscribed to this in the Unity Editor. | |
Private Member Functions | |
| IEnumerator | timer () |
| Wait 10 seconds, then trigger the event and destroy the object (if enabled). | |
| void | Start () |
| Start the timer. | |
|
private |
Start the timer.
|
private |
Wait 10 seconds, then trigger the event and destroy the object (if enabled).
| bool DespawnTimer.destroyGameObject = true |
If true, the object will be destroyed.
| UnityEvent DespawnTimer.onDespawn |
Event that's triggered when the despawn timer runs out. A function can be subscribed to this in the Unity Editor.
| float DespawnTimer.seconds = 10f |
Time until object despawns, in seconds.