Firstborn/Assets/RPG Creation Kit/Scripts/_ General/DestroyAfter.cs
Schaken-Mods 959e80cf72 assets upload
assets upload description.
2023-03-28 12:16:30 -05:00

26 lines
512 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RPGCreationKit
{
/// <summary>
/// Destroys a GameObject after X seconds.
/// </summary>
public class DestroyAfter : MonoBehaviour
{
[SerializeField] public float time = 0;
DestroyAfter(float time)
{
this.time = time;
}
// Update is called once per frame
void Start()
{
Destroy(this.gameObject, time);
}
}
}