예제 #1
0
        private IEnumerator _Timeout(int id, DuktapeFunction fn, float seconds)
        {
            var wait = seconds > 0 ? new WaitForSeconds(seconds) : null;

            yield return(wait);

            _timers.Remove(id);
            fn.Invoke();
        }
예제 #2
0
        private IEnumerator _Interval(int id, DuktapeFunction fn, float seconds)
        {
            var wait = seconds > 0 ? new WaitForSeconds(seconds) : null;

            while (true)
            {
                yield return(wait);

                fn.Invoke();
            }
        }