Beispiel #1
0
        private static IEnumerator DelayCoroutine(int frames, CoroutineData <int> f)
        {
            for (var n = 0; n < frames; ++n)
            {
                yield return(null);
            }

            f.Invoke();

            while (true)
            {
                if (f.queue.Count != 0)
                {
                    for (int i = 0; i < f.currentAction.value1; i++)
                    {
                        yield return(null);
                    }
                    f.Dequeue();
                    f.Invoke();
                }
                else
                {
                    f.Dispose();
                    break;
                }
            }
        }
Beispiel #2
0
        private static IEnumerator DelayCoroutine(float seconds, CoroutineData <float> f)
        {
            yield return(new WaitForSeconds(seconds));

            f.Invoke();

            while (true)
            {
                if (f.queue.Count != 0)
                {
                    yield return(new WaitForSecondsRealtime(f.currentAction.value1));

                    f.Dequeue();
                    f.Invoke();
                }
                else
                {
                    f.Dispose();
                    break;
                }
            }
        }