Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
DespawnTimer Class Reference

Detailed Description

Put this script on any object you want to automatically despawn after a certain amount of time.

Documentation updated 8/23/2024

Author
Stephen Nuttall

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.
 

Member Function Documentation

◆ Start()

void DespawnTimer.Start ( )
private

Start the timer.

◆ timer()

IEnumerator DespawnTimer.timer ( )
private

Wait 10 seconds, then trigger the event and destroy the object (if enabled).

Member Data Documentation

◆ destroyGameObject

bool DespawnTimer.destroyGameObject = true

If true, the object will be destroyed.

◆ onDespawn

UnityEvent DespawnTimer.onDespawn

Event that's triggered when the despawn timer runs out. A function can be subscribed to this in the Unity Editor.

◆ seconds

float DespawnTimer.seconds = 10f

Time until object despawns, in seconds.


The documentation for this class was generated from the following file: