/// <summary> /// (Cross-Game compatible) Schedule a task to execute later on as a Coroutine /// </summary> /// <param name="game"></param> /// <param name="action">The action you want to execute once it's time to run your task</param> /// <param name="scheduleType">How you want to wait for your task</param> /// <param name="amountToWait">The amount you want to wait</param> /// /// <param name="waitCondition">Wait for this to be true before executing task</param> public static void ScheduleTask(this Game game, Action action, ScheduleType scheduleType, int amountToWait, Func <bool> waitCondition = null) { MelonLoader.MelonCoroutines.Start(TaskScheduler.Coroutine(action, scheduleType, amountToWait, waitCondition)); }