public void Tick() { UpdateCoroutineServiceTime(); _coroutineService.TickCoroutines(); _coroutineService.TickFixedCoroutines(); _coroutineService.TickLateCoroutines(); }
public void CoroutineService_WaitForFixedTickAsync_ReturnTaskThatCompletesAfterFixedTick() { var coroutineService = new CoroutineService(); Task task = coroutineService.WaitForFixedTickAsync(); coroutineService.TickFixedCoroutines(); Assert.IsTrue(task.IsCompleted, "Task did not complete"); }
public void CoroutineService_WaitForFixedTick_CompletesCoroutineAfterFixedTick() { bool didComplete = false; var coroutineService = new CoroutineService(); IEnumerator RunCoroutine() { yield return(coroutineService.WaitForFixedTick()); didComplete = true; }; coroutineService.StartCoroutine(RunCoroutine()); coroutineService.TickFixedCoroutines(); Assert.IsTrue(didComplete, "Did not complete"); }
public void CoroutineService_TickCoroutines_TicksFixedScheduledCoroutine() { bool isCompleted = false; var coroutineService = new CoroutineService(); IEnumerator RunCoroutine() { yield return(coroutineService.WaitForFixedTick()); isCompleted = true; } coroutineService.StartCoroutine(RunCoroutine()); coroutineService.TickFixedCoroutines(); Assert.IsTrue(isCompleted, "Coroutine did not complete"); }