private static System.Collections.IEnumerator UntilCoroutine(IVoidable voidable, System.Func <bool> validationQuery) { while (voidable.IsValid && validationQuery()) { yield return(null); } voidable.Void(); }
public static void VoidWhenFalse(this IVoidable voidable, System.Func <bool> validationQuery) { ExternalCoroutine.StartCoroutine(UntilCoroutine(voidable, validationQuery)); }