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#?