Наследование: MonoBehaviour
        public IEnumerator Stop()
        {
            var executer  = new CoroutineExecuterGameObject();
            var coroutine = new TestCoroutine2();

            executer.Initialize();

            Assert.False(coroutine.IsCompleted);
            Assert.False(coroutine.IsStarted);
            Assert.False(coroutine.IsEnded);

            executer.Start(coroutine);

            Assert.False(coroutine.IsCompleted);
            Assert.True(coroutine.IsStarted);
            Assert.False(coroutine.IsEnded);

            yield return(null);

            executer.Stop(coroutine);

            yield return(null);

            Assert.False(coroutine.IsCompleted);
            Assert.True(coroutine.IsStarted);
            Assert.False(coroutine.IsEnded);

            executer.Uninitialize();
        }
Пример #2
0
        public IEnumerator HasResultValueType()
        {
            var coroutine = new TestCoroutine2();

            Assert.True(coroutine.HasResult);

            yield return(coroutine);

            Assert.True(coroutine.HasResult);
        }
        public IEnumerator RoutineBreak()
        {
            var coroutine = new TestCoroutine2();

            Assert.False(coroutine.IsStarted);
            Assert.False(coroutine.IsCompleted);

            yield return(coroutine);

            Assert.True(coroutine.IsStarted);
            Assert.True(coroutine.IsCompleted);
        }
        public IEnumerator RoutineBreakWithStart()
        {
            var executer  = new GameObject().AddComponent <CoroutineExecuter>();
            var coroutine = new TestCoroutine2();

            Assert.False(coroutine.IsStarted);
            Assert.False(coroutine.IsCompleted);

            executer.StartCoroutine(coroutine);

            Assert.True(coroutine.IsStarted);
            Assert.False(coroutine.IsCompleted);

            yield return(null);

            Assert.True(coroutine.IsStarted);
            Assert.True(coroutine.IsCompleted);
        }