Ejemplo n.º 1
0
        private IEnumerator waitForResumedEventTest()
        {
            bool             resumed   = false;
            RadicalCoroutine coroutine = RadicalCoroutine.Create(testCoroutine(), "testCoroutine");

            coroutine.EResumed += delegate
            {
                resumed = true;
            };
            coroutine.Pause();
            StartCoroutine(coroutine.Enumerator);
            yield return(null);

            IntegrationTestEx.FailIf(resumed);
            coroutine.Resume();
            yield return(null);

            IntegrationTestEx.FailIf(!resumed, "coroutine did not dispatch EResumed one frame after resumed");
        }
Ejemplo n.º 2
0
        private IEnumerator waitForPausedEventTest()
        {
            bool             paused    = false;
            RadicalCoroutine coroutine = RadicalCoroutine.Create(testCoroutine(), "testCoroutine");

            coroutine.EPaused += delegate
            {
                paused = true;
            };
            coroutine.Pause();
            StartCoroutine(coroutine.Enumerator);
            yield return(new WaitForFrame(5));

            IntegrationTestEx.FailIf(!paused, "coroutine did not dispatch EPaused after within 5 frames.");
            IntegrationTestEx.FailIf(!coroutine.Paused);
            IntegrationTestEx.FailIf(coroutine.Disposed);
            IntegrationTestEx.FailIf(coroutine.Completed);
            IntegrationTestEx.FailIf(coroutine.Cancelled);
        }