Coroutines within coroutines (C#)

I’m trying to do something in C# that I know how to do in Javascript. I want to create customize “wait” functions akin to WaitForSeconds.

function MainSequence() {
Debug.Log("Starting to wait");
yield WaitForSomeCondition();
Debug.Log("Condition has been met, carrying on");
//other code
}

function WaitForSomeCondition() {
while (someConditionIsNotMetYet) yield;
}

How do I create this kind of sub-coroutine in C#?

The same way, aside from C# syntax of course. (Which is described in the docs if you’re not familiar.)

–Eric

Ah! I didn’t realize that StartCoroutine could be used that way. Thank you.