Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Unity3dAsyncAwaitUtil usable in Editor
As per modesttree/Unity3dAsyncAwaitUtil/modesttree#9, using Unity3dAsyncAwaitUtil in Editor scripts causes an NPE, because `SyncContextUtil.Install` is never called to initialize global variables `SyncContextUtil.UnitySynchronizationContext` and `SyncContextUtil.UnityThreadId`. Fix this by adding the `[InitializeOnLoadMethod()]` attribute to the `SyncContextUtil.Install` method. Note that the existing `[RuntimeInitializeOnLoadMethod]` attribute is still needed in order for `SyncContextUtil.Install` to be invoked when entering Play Mode. Fixes modesttree/Unity3dAsyncAwaitUtil/modesttree#9
- Loading branch information