WebGL 线程补丁 此插件使更多异步 await 代码在 Unity WebGL 中运行。例如,以下代码都将运行:charp task.C…
WebGL 线程补丁 此插件使更多异步 await 代码在 Unity WebGL 中运行。例如,以下代码都将运行:charp task.C…
This plugin makes more async await code works in Unity WebGL. For instance all of following will work:
task.ContinueWith(t => Debug.Log("ContinuWith works"));
Task.Run(() => Debug.Log("Task.Run works!"));
await task.ConfigureAwait(false);
await Task.Delay(1000);This plug-in use IIl2CppProcessor callback to hijack mscorelib and change some methods implementation. It change ThreadPool methods that enqueue work items to delegate work to SynchronizationContext so all items will be executed in same thread. Also it patch Timer implementation to use Javascript timer functionality.
All tasks will be executed by just one thread so any blocking calls will freeze whole application. Basically it similar to async await behavior in Blazor.
暂无开放 Issues,或尚未同步最近议题。