Unity Coroutine — WaitUntil Guide
;
The parameter takes a Func that returns a bool type.
Because of this, the function passed to WaitUntil keeps looping until it returns true. Once it returns true, the coroutine proceeds past the yield.
Note:
In
Func<T>, the last generic type parameter represents the return type.For example,
Func<int, bool>means the parameter is of typeintand the return type isbool.
Unity - Scripting API: WaitUntil.WaitUntil
Unity - Scripting API: WaitUntil