Add UniTask.WaitUntil overload which takes a target to avoid closure allocation
laicasaane opened this issue · comments
Laicasaane commented
For the context of this proposal:
Since UniTask.WaitUntilValueChanged uses IEqualityComparer to detect if the value has changed, its logic is totally different from UniTask.WaitUntil. So I can't just replace WaitUntil with WaitUntilValueChanged.
My use case is:
var component = await UniTask.WaitUntil(gameObject, static x => x.GetComponent<MyComponent>());
// do something to the retrieved component
Yoshifumi Kawai commented
I think it's a good idea to add (TState, Func) overloads throughout.