From 1ab047b5fdd933c38ba0519ec2e83a44512ea8d7 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 17:46:11 +0800
Subject: [PATCH] webgl代码合并 1

---
 Main/System/Debug/DebugUtility.cs |   68 ++++++++++++++++++----------------
 1 files changed, 36 insertions(+), 32 deletions(-)

diff --git a/Main/System/Debug/DebugUtility.cs b/Main/System/Debug/DebugUtility.cs
index 6fc4385..c66db29 100644
--- a/Main/System/Debug/DebugUtility.cs
+++ b/Main/System/Debug/DebugUtility.cs
@@ -39,49 +39,53 @@
     public void Init()
     {
         isWhiteListAccount = false;
-        if (VersionConfig.Get().debugVersion)
+        VersionConfig.GetAsync().ContinueWith(config =>
         {
-            debugAccount = true;
-        }
-        else
-        {
-            var parentDirectory = Directory.GetParent(Application.persistentDataPath);
-            debugAccount = File.Exists(parentDirectory + "/Debug");
-        }
-
-        if (LocalSave.GetString("#@#BrancH") != string.Empty)
-        {
-            var branch = LocalSave.GetString("#@#BrancH");
-            int tmpbranch;
-            int.TryParse(LocalSave.GetString("#@#BrancH").Substring(1), out tmpbranch);
-            if (branch.StartsWith("d") && tmpbranch != 0)
+            if (config != null && config.debugVersion)
             {
-                debugBranch = tmpbranch;
                 debugAccount = true;
             }
-            else if (branch.StartsWith("r") && tmpbranch != 0)
-            {
-                debugBranch = tmpbranch;
-                debugAccount = false;
-            }
-        }
-
-        if (debugAccount)
-        {
-            if (Application.isMobilePlatform)
+            else
             {
                 var parentDirectory = Directory.GetParent(Application.persistentDataPath);
-                if (File.Exists(parentDirectory + "/Debug"))
+                debugAccount = File.Exists(parentDirectory + "/Debug");
+            }
+
+            if (LocalSave.GetString("#@#BrancH") != string.Empty)
+            {
+                var branch = LocalSave.GetString("#@#BrancH");
+                int tmpbranch;
+                int.TryParse(LocalSave.GetString("#@#BrancH").Substring(1), out tmpbranch);
+                if (branch.StartsWith("d") && tmpbranch != 0)
                 {
-                    var content = File.ReadAllText(parentDirectory + "/Debug");
-                    if (!string.IsNullOrEmpty(content))
+                    debugBranch = tmpbranch;
+                    debugAccount = true;
+                }
+                else if (branch.StartsWith("r") && tmpbranch != 0)
+                {
+                    debugBranch = tmpbranch;
+                    debugAccount = false;
+                }
+            }
+
+            if (debugAccount)
+            {
+                if (Application.isMobilePlatform)
+                {
+                    var parentDirectory = Directory.GetParent(Application.persistentDataPath);
+                    if (File.Exists(parentDirectory + "/Debug"))
                     {
-                        var json = JsonMapper.ToObject<DebugBranch>(File.ReadAllText(parentDirectory + "/Debug"));
-                        debugBranch = json.branch;
+                        var content = File.ReadAllText(parentDirectory + "/Debug");
+                        if (!string.IsNullOrEmpty(content))
+                        {
+                            var json = JsonMapper.ToObject<DebugBranch>(File.ReadAllText(parentDirectory + "/Debug"));
+                            debugBranch = json.branch;
+                        }
                     }
                 }
             }
-        }
+        }).Forget();
+        
 
 
     }

--
Gitblit v1.8.0