Earlier intialization for Unitask, depending on unity version

master
David Klein 2023-09-04 11:00:15 +02:00
parent c1042b32b7
commit 3121903fa3
1 changed files with 5 additions and 1 deletions

View File

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