Firstborn/Assets/RPG Creation Kit/Scripts/Magic System/SpellExplodeAfter.cs

32 lines
641 B
C#
Raw Normal View History

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