Esempio n. 1
0
        static int FindLast(UniRx.InternalUtil.MicroCoroutine mc)
        {
            var coroutines  = mc.GetType().GetField("coroutines", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);
            var enumerators = (IEnumerator[])coroutines.GetValue(mc);

            int tail = -1;

            for (int i = 0; i < enumerators.Length; i++)
            {
                if (enumerators[i] == null)
                {
                    if (tail == -1)
                    {
                        tail = i;
                    }
                }
                else
                {
                    if (tail != -1)
                    {
                        throw new Exception("what's happen?");
                    }
                }
            }

            if (tail == -1)
            {
                tail = enumerators.Length;
            }
            return(tail);
        }
Esempio n. 2
0
        static int GetTailDynamic(UniRx.InternalUtil.MicroCoroutine mc)
        {
            var tail = mc.GetType().GetField("tail", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);

            return((int)tail.GetValue(mc));
        }
Esempio n. 3
0
        static IEnumerator[] GetInnerCoroutineDynamic(UniRx.InternalUtil.MicroCoroutine mc)
        {
            var coroutines = mc.GetType().GetField("coroutines", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance);

            return((IEnumerator[])coroutines.GetValue(mc));
        }
Esempio n. 4
0
        static void RefreshDynamic(UniRx.InternalUtil.MicroCoroutine mc)
        {
            var mi = mc.GetType().GetMethod("Refresh", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);

            mi.Invoke(mc, null);
        }