UniTask

版本 v2.5.0·更新於 2023-12-17

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

模組介紹 作者原文

UniTask 2.5.0

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

  • Struct based UniTask 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.

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack

檔案與校驗

檔案名稱
UniTask-2.5.0.zip
檔案大小
366.7 KiB