Skip to content

Commit

Permalink
Merge pull request #489 from Merglasch/EarlyInit
Browse files Browse the repository at this point in the history
Earlier intialization for Unitask, depending on unity version
  • Loading branch information
hadashiA authored Sep 14, 2023
2 parents c170af5 + 3121903 commit 7c62904
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ static PlayerLoopSystem[] InsertUniTaskSynchronizationContext(PlayerLoopSystem l
return dest.ToArray();
}

[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
#if UNITY_2020_1_OR_NEWER
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
#else
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
#endif
static void Init()
{
// capture default(unity) sync-context.
Expand Down

0 comments on commit 7c62904

Please sign in to comment.