public IEnumerator Start()
        {
            var executer  = new CoroutineExecuterGameObject();
            var coroutine = new TestCoroutine();

            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(coroutine);

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

            executer.Uninitialize();
        }
Esempio n. 2
0
        public IEnumerator Stop()
        {
            var executer = new CoroutineExecuterGameObject();
            var runner   = new CoroutineRunner(executer);

            executer.Initialize();

            runner.Start(WaitForUpdateRoutine(10));

            yield return(null);

            yield return(null);

            yield return(null);

            yield return(null);

            Assert.True(runner.IsRunning);

            runner.Stop();

            Assert.False(runner.IsRunning);

            yield return(null);

            Assert.False(runner.IsRunning);

            executer.Uninitialize();
        }
        public void Ctor()
        {
            var executer = new CoroutineExecuterGameObject("Executer");

            executer.Initialize();

            Assert.NotNull(executer.Component);
            Assert.True(executer.Component != null);
            Assert.AreEqual("Executer", executer.Component.gameObject.name);

            executer.Uninitialize();
        }
        public IEnumerator Dispose()
        {
            var executer = new CoroutineExecuterGameObject();

            executer.Initialize();

            Assert.True(executer.Component != null);
            Assert.True(executer.IsComponentExists);

            executer.Uninitialize();

            yield return(null);

            Assert.False(executer.IsComponentExists);
        }