using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class WaitEvent : MonoBehaviour
{
    public float seconds = 0;
    public UnityEvent unityEvent;

    private void OnEnable()
    {
        StartCoroutine(WaitCO());
    }

    private IEnumerator WaitCO()
    {
        yield return new WaitForSeconds(seconds);
        if (unityEvent != null)
        {
            Debug.Log("INVOKE");
            unityEvent.Invoke();
        }
    }
}
