All I can find online is "How to check if a coroutine is running", which is not what I want.
Say if I have a coroutine with
yield return new WaitUntil(()=> SomeBool);
Is there a way to know if this statement is still "pending"?
Because if I use the Boolean trick such as
isRunning = true;
yield return new WaitUntil(()=>SomeBool);
isRunning = false;
The isRunning flag will "always" be true if I stop the coroutine before SomeBool is set to true.
I have tested that this is indeed the case! Anything after the yield statement will never be run!
And since it's never ran, any checking is useless, whether it's isRunning or SomeBool.
So it failed the function of "Checking if the coroutine is still running"!
Is there a way to "do the right job"?
So if I finally set SomeBool to true from another part of the code, I know that there is still a WaitUntil waiting for it? If not, then somehow restart the coroutine so it won't "stuck forever and crash the game"!?
Much appreciated!