Skip to content

add UniTask.AsValueTask for Unity#533

Merged
neuecc merged 3 commits intoCysharp:masterfrom
doyasu24:feature/add-unitask-asvaluetask-for-unity
Jan 24, 2024
Merged

add UniTask.AsValueTask for Unity#533
neuecc merged 3 commits intoCysharp:masterfrom
doyasu24:feature/add-unitask-asvaluetask-for-unity

Conversation

@doyasu24
Copy link
Contributor

close #532

I moved src/UniTask.NetCore/NetCore/UniTask.AsValueTask.cs to src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.AsValueTask.cs and made some changes.
I confirmed that the extension method works in Unity 2021.3 .NET Standard 2.1 and UniTask.NetCoreTests test was successful.

I am not sure if this change is ok. Please give me your opinion.

@neuecc
Copy link
Member

neuecc commented Jan 19, 2024

This is because ValueTask was not part of the Unity standard, so there is no problem to include it now!
OK, I will accept the change and release it.
Are there any other concerns?

@doyasu24 doyasu24 marked this pull request as ready for review January 19, 2024 13:21
@doyasu24
Copy link
Contributor Author

I understand why it was only implemented in .NET Core!
Please merge this PR.

@timcassell
Copy link

Rather than removing #if !UNITY_2018_3_OR_NEWER, you should add #if UNITY_2021_2_OR_NEWER.

@doyasu24
Copy link
Contributor Author

Removing #if !UNITY_2018_3_OR_NEWER caused compile errors in Unity 2019.4.

I have confirmed that the compile error no longer occurs in the following three environments

  • Unity 2019.4 .NET Standard 2.0
  • Unity 2021.3 .NET Standard 2.1
  • .NET Core

Thank you!

@neuecc
Copy link
Member

neuecc commented Jan 24, 2024

thanks, merged and release soon!

@neuecc neuecc merged commit 6cd0026 into Cysharp:master Jan 24, 2024
@doyasu24 doyasu24 deleted the feature/add-unitask-asvaluetask-for-unity branch January 24, 2024 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding ValueTask.AsUniTask() and UniTask.AsValueTask() for Unity

3 participants