Ejemplo n.º 1
0
        private CoroutineState CreateCoroutineState(Coroutine executingCoroutine)
        {
            CoroutineState state = new CoroutineState()
            {
                Coroutine     = executingCoroutine,
                Enumerator    = executingCoroutine.Execute(),
                WaitForObject = null
            };

            return(state);
        }
Ejemplo n.º 2
0
        private Exception StartAndMakeFirstIteration(Coroutine coroutine)
        {
            var iterator = coroutine.Execute();

            var state = new EventCoroutineState()
            {
                CoroutineID = currentCoroutineID++,
                Coroutine   = coroutine,
                Iterator    = iterator
            };


            if (!AdvanceCoroutine(state.CoroutineID, coroutine, iterator))
            {
                // We add it to running coroutines if not completed
                runningCoroutines.Add(state.CoroutineID, state);
            }

            return(coroutine.Exception);
        }