yield function until a boolean is true?

How does one tell a function to wait until a boolean becomes true?

quick example of situation

function attackOne(){

run = true; walk = false; LookAtFoe = true;


// some how tell this function to wait and continue until bool is true?
if(inDistanceFoe){
animation.Crossfade("Punch");
FoeHealth -=20;
}

run = false;
StartCoroutine("backUp");
StopCoroutine("attackOne");
}

Thank you

while( !myBoolTrue )
{
yield return null;
}

Use Unity’s WaitUntil or WaitWhile.