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(); }
private IEnumerator _Interval(int id, DuktapeFunction fn, float seconds) { var wait = seconds > 0 ? new WaitForSeconds(seconds) : null; while (true) { yield return(wait); fn.Invoke(); } }