using System.Collections;
using UnityEngine;
namespace Utils
{
public class Runner : MonoBehaviour
{
private static Runner _instance;
///
/// When the game loads, create an instance of this class, and make sure it isn't destroyed between scenes
///
[RuntimeInitializeOnLoadMethod]
private static void OnSceneLoad()
{
_instance = new GameObject ("Runner").AddComponent();
DontDestroyOnLoad (_instance);
}
///
/// Run a coroutine
///
public static void Run(IEnumerator coroutine)
{
_instance.StartCoroutine(coroutine);
}
}
}