ToTask.AsyncOperation
A unity package for converting AsyncOperation objects to tasks
dev.comradevanti.totask.asyncoperation Unity Compatibility
Unity 6 Supported
2023.2 Supported
2023.1 Supported
2022.3 LTS Supported
2021.3 LTS Supported
2020.3 LTS Not tested
2019.4 LTS Not tested
Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/asyncoperation.git 
README Markdown
Copy this to your project's README.md
## Installation
Add **ToTask.AsyncOperation** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/asyncoperation.git
```
[](https://www.pkglnk.dev/pkg/asyncoperation)README
ToTask.AsyncOperation
Unity package for converting builtin AsyncOperation objects to .Net Tasks.
⚠️ Development is paused ⚠️
No new features will be added or bugs fixed unless requested through an issue.
If you wish to fork this repository and continue the work, you are very welcome
to do so.
Installation
Install via OpenUPM using
openupm add dev.comradevanti.totask.asyncoperation
Usage
Simply add .ToTask() to the operation object in order to await it. This
will create a value-less Task. If you want to add a result-value to the
task, you can call one of the overloads which allow you to specify one.
// Example operation
var op = SceneManager.LoadSceneAsync("MyScene");
// Simple value-less task
await op.ToTask();
// Await the task with a specific result value
var v1 = await op.ToTask(5);
// Await the task with the result being calculated by the given function
var v2 = await op.ToTask(() => "done");
Comments
No comments yet. Be the first!
Sign in to join the conversation
Sign In