I am using Unity 2020.3 with enabled support for C# 8. I am able to use await foreach, switch expressions and other fancy stuff. UniTask’s IUniTaskAsyncEnumerable also works fine. But I would like to use the default .NET implementation - IAsyncEnumerable.
However, I get the “type or namespace name ‘IAsyncEnumerable<>’ could not be found” error, even with the “using System.Collections.Generic;”
I guess it’s not included in Unity’s version of the framework. Where can I get it?
And how to know what else isn’t included?
Maybe one of these links will help:
Not sure why IAsyncEnumerable is not supported. Maybe it’s a side effect of asynchronous disposables not being supported.
Your links really helped! IAsyncEnumerable is the part of async streams, and they are indeed in the list of unsupported features. It’s still possible to use them with UniTask though, but the syntax is a bit different.
Have you test this feature in unity 2022.2 yet ?
2022.2. and later supports IAsyncEnumerable