fgm24/Assets/Scripts/Misc/DestroyAfter.cs

16 lines
312 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DestroyAfter : MonoBehaviour
{
[SerializeField]
private float destroyInSeconds = 1.0f;
public void Init(float delay)
{
this.destroyInSeconds = delay;
Destroy(gameObject, delay);
}
}