16 lines
335 B
C#
16 lines
335 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
public class DestroyAfterTimeParticle : MonoBehaviour {
|
|
[Tooltip("Time to destroy")]
|
|
public float timeToDestroy = 0.8f;
|
|
/*
|
|
* Destroys gameobject after its created on scene.
|
|
* This is used for particles and flashes.
|
|
*/
|
|
void Start () {
|
|
Destroy (gameObject, timeToDestroy);
|
|
}
|
|
|
|
}
|