public static IPromise AsPromise(this IEnumerator coroutine)
        {
            var prom = new Promise();

            BPF_CoroutineInvoker.Invoke(coroutine, prom.Resolve);
            return(prom);
        }
        public static IPromise WaitAFrame(this IPromise p, int n = 1)
        {
            IEnumerator OneFrame(int x)
            {
                for (var i = 0; i < x; i++)
                {
                    yield return(null);
                }
            }

            var next = new Promise();

            p.Done(() => BPF_CoroutineInvoker.Invoke(OneFrame(n), next.Resolve));
            return(next);
        }