示例#1
0
        public static Routiner runRoutine(this MonoBehaviour go, IEnumerator routine)
        {
            var wroutine = new Routiner(routine);

            wroutine.unityRoutine = go.StartCoroutine(wroutine);
            return(wroutine);
        }
示例#2
0
        private bool runSubRoutine()
        {
            bool moved = subRoutine.MoveNext();

            if (!moved)
            {
                Current    = subRoutine.Current;
                subRoutine = null;
            }
            return(moved);
        }
示例#3
0
        private bool runMainRoutine()
        {
            bool moved = mainRoutine.MoveNext();

            Current = mainRoutine.Current;
            if (moved && mainRoutine.Current is IEnumerator)
            {
                var newSubroutine = (IEnumerator)mainRoutine.Current;
                if (subRoutine != null)
                {
                    Debug.LogWarning("over writing existing subroutine");
                }
                subRoutine = new Routiner(newSubroutine);
            }
            finished = moved;
            return(moved);
        }