Merge pull request #489 from Merglasch/EarlyInit

Earlier intialization for Unitask, depending on unity version
master
hadashiA 2023-09-14 15:43:34 +09:00 committed by GitHub
commit 7c62904a74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -285,7 +285,11 @@ namespace Cysharp.Threading.Tasks
return dest.ToArray(); return dest.ToArray();
} }
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] #if UNITY_2020_1_OR_NEWER
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
#else
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
#endif
static void Init() static void Init()
{ {
// capture default(unity) sync-context. // capture default(unity) sync-context.