Ejemplo n.º 1
0
 public void Tick()
 {
     UpdateCoroutineServiceTime();
     _coroutineService.TickCoroutines();
     _coroutineService.TickFixedCoroutines();
     _coroutineService.TickLateCoroutines();
 }
Ejemplo n.º 2
0
        public void CoroutineService_WaitForFixedTickAsync_ReturnTaskThatCompletesAfterFixedTick()
        {
            var coroutineService = new CoroutineService();

            Task task = coroutineService.WaitForFixedTickAsync();

            coroutineService.TickFixedCoroutines();

            Assert.IsTrue(task.IsCompleted, "Task did not complete");
        }
Ejemplo n.º 3
0
        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");
        }
Ejemplo n.º 4
0
        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");
        }