Enumerators for the types inheriting AsyncOperation are not consumed as expected. All AsyncOperations have isDone property that needs to be checked before completing the enumeration. This is done correctly for the base type by using the Unwrap... method, but the types inheriting it are handled as an unkown case.
Example
Without this fix, when a webrequest is performed in Edit-mode using UnityWebRequest.Get() and AsAsyncOperationObservable extension, the observable publishes a value immediately without waiting request to complete.
Solution
Changed comparison to handle all types assignable to the AsyncOperation base class, so the completion is waited for them before publishing a value.
Problem
Enumerators for the types inheriting
AsyncOperation
are not consumed as expected. AllAsyncOperation
s haveisDone
property that needs to be checked before completing the enumeration. This is done correctly for the base type by using theUnwrap...
method, but the types inheriting it are handled as an unkown case.Example
Without this fix, when a webrequest is performed in Edit-mode using
UnityWebRequest.Get()
andAsAsyncOperationObservable
extension, the observable publishes a value immediately without waiting request to complete.Solution
Changed comparison to handle all types assignable to the
AsyncOperation
base class, so the completion is waited for them before publishing a value.