﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EventExample : MonoBehaviour
{
    public DataCoroutineExample data;

    // Start is called before the first frame update
    void OnEnable()
    {
        UnityEventDispatcher.OnFixedUpdate += OnFixedUpdate;
    }

    private void OnFixedUpdate()
    {
        //spam if you want
        //Debug.Log("Fixed Update");
    }

    void OnDisable()
    {
        UnityEventDispatcher.OnFixedUpdate -= OnFixedUpdate;
    }

    private void OnGUI()
    {
        if (GUILayout.Button("Scriptable Object Coroutine"))
        {
            data.Countdown();
        }
    }
}
