diff --git a/Assets/Scenes/GameLauncher.unity b/Assets/Scenes/GameLauncher.unity index 443a1dd..b5cd01a 100644 --- a/Assets/Scenes/GameLauncher.unity +++ b/Assets/Scenes/GameLauncher.unity @@ -195,7 +195,7 @@ MonoBehaviour: m_EditorClassIdentifier: showLogs: 1 maxLogCount: 200 - logWindowWidth: 700 + logWindowWidth: 335.5 logWindowHeight: 1280 autoScroll: 1 showLogMessages: 1 diff --git a/Assets/Scripts/GameLauncher.cs b/Assets/Scripts/GameLauncher.cs index fcfe945..f10674b 100644 --- a/Assets/Scripts/GameLauncher.cs +++ b/Assets/Scripts/GameLauncher.cs @@ -11,8 +11,13 @@ using UnityEngine.SceneManagement; public class GameLauncher : MonoBehaviour { + + public static GameLauncher Instance { get; private set; } + void Awake() { + Instance = this; + // 在WebGL环境中禁用Best HTTP的数据库功能 // 初始化控制台 @@ -26,7 +31,11 @@ public class GameLauncher : MonoBehaviour void Start() { - CreateGameModules(); + MotionEngine.CreateModule(); + MotionEngine.CreateModule(); + + MotionEngine.GetModule().ParseUrlCode(); + // CreateGameModules(); } void Update() @@ -44,18 +53,15 @@ public class GameLauncher : MonoBehaviour public async UniTask CreateGameModules() { - MotionEngine.CreateModule(); - MotionEngine.CreateModule(); - - MotionEngine.GetModule().ParseUrlCode(); + Debug.Log("=== 开始初始化流程 ==="); - - // 第一步:获取code - await TestBasicGetRequest(); + // + // // 第一步:获取code + // await TestBasicGetRequest(); // 第二步:使用code获取token - await GetAccessToken(); + await GetAccessToken(); SceneManager.LoadScene("GameMain"); Debug.Log("=== 初始化流程完成 ==="); diff --git a/Assets/Scripts/MessageHandler.cs b/Assets/Scripts/MessageHandler.cs index 2f829e3..ca700d6 100644 --- a/Assets/Scripts/MessageHandler.cs +++ b/Assets/Scripts/MessageHandler.cs @@ -61,6 +61,9 @@ public class MessageHandler : MonoBehaviour { Debug.Log($"正在处理消息代码: {messageData.code}"); Apis.SetCode(messageData.code); + + GameLauncher.Instance.CreateGameModules(); + } // // 根据type参数执行相应的处理逻辑 diff --git a/wwb/Build/wwb.data.unityweb b/wwb/Build/wwb.data.unityweb index d8410c6..ba12f52 100644 Binary files a/wwb/Build/wwb.data.unityweb and b/wwb/Build/wwb.data.unityweb differ diff --git a/wwb/Build/wwb.framework.js.unityweb b/wwb/Build/wwb.framework.js.unityweb index 78473ea..2bc53ec 100644 Binary files a/wwb/Build/wwb.framework.js.unityweb and b/wwb/Build/wwb.framework.js.unityweb differ diff --git a/wwb/Build/wwb.wasm.unityweb b/wwb/Build/wwb.wasm.unityweb index 2355e16..1672fe4 100644 Binary files a/wwb/Build/wwb.wasm.unityweb and b/wwb/Build/wwb.wasm.unityweb differ diff --git a/wwb/index.html b/wwb/index.html index 087d9a5..0553df9 100644 --- a/wwb/index.html +++ b/wwb/index.html @@ -1,65 +1,66 @@ - + Unity WebGL Player | WXGame - - -
- -
+ + +
+ +
-
+
-
-
- +
+
- + - +