Bobbie-UniTask icon

UniTask

Provides an efficient allocation free async/await integration for Unity.

Last updated 11 months ago
Total downloads 1489021
Total rating 16 
Categories Libraries BepInEx
Dependency string Bobbie-UniTask-2.5.0
Dependants 1533 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

UniTask 2.5.0

Provides an efficient allocation free async/await integration for Unity.

  • Struct based UniTask<T> and custom AsyncMethodBuilder to achieve zero allocation
  • Makes all Unity AsyncOperations and Coroutines awaitable
  • PlayerLoop based task(UniTask.Yield, UniTask.Delay, UniTask.DelayFrame, etc..) that enable replacing all coroutine operations
  • MonoBehaviour Message Events and uGUI Events as awaitable/async-enumerable
  • Runs completely on Unity's PlayerLoop so doesn't use threads and runs on WebGL, wasm, etc.
  • Asynchronous LINQ, with Channel and AsyncReactiveProperty
  • TaskTracker window to prevent memory leaks
  • Highly compatible behaviour with Task/ValueTask/IValueTaskSource

For technical details, see blog post: UniTask v2 — Zero Allocation async/await for Unity, with Asynchronous LINQ
For advanced tips, see blog post: Extends UnityWebRequest via async decorator pattern — Advanced Techniques of UniTask

For usage details, check the original README.

Licensing

I did not make this library, I am simply uploading it so it can be used as a dependency in mods. The original repo (licensed under MIT) can be found here.

For Developers

NOTE: This is different than the UniTask package found on nuget!

The UniTask package on nuget is just for .NET, and doesn't contain many useful Unity-based utilities you may want.

If you'd like to use UniTask, I'd recommend referencing this package's DLLs directly.