public static WrappedCoroutine <T> Wrap <T>(IEnumerable <T> f, bool throwErrors = false) { var co = new Coroutine <T>(f) { ThrowErrors = throwErrors }; var wrapped = new WrappedCoroutine <T>((args) => { if (co.status == CoStatus.Dead) { co.Reset(); } return(co.Resume(args)); }); return(wrapped); }
void InitializeSkill() { meleeAttackWC = new WrappedCoroutine(this, MeleeAttack); }