Skip to content
This repository was archived by the owner on Sep 7, 2022. It is now read-only.

Commit 3068262

Browse files
committed
fix desktop player crash
1 parent 708b0f1 commit 3068262

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

com.unity.uiwidgets/Runtime/ui/hooks.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ namespace Unity.UIWidgets.ui {
1212
public static class Hooks {
1313

1414
static bool hooked = false;
15+
1516
#if UNITY_EDITOR
1617
[UnityEditor.InitializeOnLoadMethod]
1718
#else
18-
[RuntimeInitializeOnLoadMethod]
19+
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
1920
#endif
2021
static unsafe void hook() {
2122
D.assert(!hooked);
@@ -34,6 +35,7 @@ static unsafe void hook() {
3435
ui_._dispatchPlatformMessage,
3536
ui_._dispatchPointerDataPacket);
3637
}
38+
3739

3840
public static void tryHook() {
3941
if (hooked) {

0 commit comments

Comments
 (0)