/// <summary> /// Attach a scheduler to render loop. /// Must be called before using coroutine. /// </summary> public static void Run() { if (instance != null) { return; } instance = new CoroutineScheduler(); instance.Attach(); }
/// <summary> /// Stop a scheduler. All coroutines will be released. /// </summary> public static void Stop() { instance?.Detach(); instance = null; }