From 0b64703422c3e39b48888c2de37121c97dd103a7 Mon Sep 17 00:00:00 2001 From: changyunjia <905640960@qq.com> Date: Fri, 12 Jun 2026 15:22:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._1765185287.json => public_conf_1765185287.txt} | 0 ...7.json.meta => public_conf_1765185287.txt.meta} | 2 +- .../Scripts/ConfigLoader/FileNetworkManager.cs | 11 ++++++----- ProjectSettings/GvhProjectSettings.xml | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 6 deletions(-) rename Assets/Resources/Configs/{public_conf_1765185287.json => public_conf_1765185287.txt} (100%) rename Assets/Resources/Configs/{public_conf_1765185287.json.meta => public_conf_1765185287.txt.meta} (75%) diff --git a/Assets/Resources/Configs/public_conf_1765185287.json b/Assets/Resources/Configs/public_conf_1765185287.txt similarity index 100% rename from Assets/Resources/Configs/public_conf_1765185287.json rename to Assets/Resources/Configs/public_conf_1765185287.txt diff --git a/Assets/Resources/Configs/public_conf_1765185287.json.meta b/Assets/Resources/Configs/public_conf_1765185287.txt.meta similarity index 75% rename from Assets/Resources/Configs/public_conf_1765185287.json.meta rename to Assets/Resources/Configs/public_conf_1765185287.txt.meta index 54bb9d6..f214d6b 100644 --- a/Assets/Resources/Configs/public_conf_1765185287.json.meta +++ b/Assets/Resources/Configs/public_conf_1765185287.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7ba7c6a75110f483683dc4885aee0758 +guid: f8c67570025fefa448706dadc37c5988 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/SGModule/ConfigLoader/SGModule/Scripts/ConfigLoader/FileNetworkManager.cs b/Assets/SGModule/ConfigLoader/SGModule/Scripts/ConfigLoader/FileNetworkManager.cs index a5167c7..55177a5 100644 --- a/Assets/SGModule/ConfigLoader/SGModule/Scripts/ConfigLoader/FileNetworkManager.cs +++ b/Assets/SGModule/ConfigLoader/SGModule/Scripts/ConfigLoader/FileNetworkManager.cs @@ -44,13 +44,14 @@ namespace SGModule.ConfigLoader public void CopyStreamingAssetsToPersistentDataPath(Action onComplete = null) { + Debug.Log("0000000000000000000000000000001"); // 如果目标文件夹不存在,创建它 if (!Directory.Exists(_configFolderPath)) { Directory.CreateDirectory(_configFolderPath); } - - StartCoroutine(CopyFile(onComplete)); +Debug.Log("0000000000000000000000000000002"); + CopyFile(onComplete); } private void HandleInitializationError() @@ -68,7 +69,7 @@ namespace SGModule.ConfigLoader // 比如:显示弹窗或退出程序 } - private IEnumerator CopyFile(Action onComplete = null) + private void CopyFile(Action onComplete = null) { @@ -80,6 +81,7 @@ namespace SGModule.ConfigLoader // var jsonFileName = Path.GetFileName(jsonLocation.PrimaryKey); // 加载 JSON 文件 // var textAssetAsync = Addressables.LoadAssetAsync(jsonLocation); + Debug.Log("0000000000000000000000000000003"); TextAsset[] files = Resources.LoadAll("Configs"); // yield return textAssetAsync; @@ -89,11 +91,10 @@ namespace SGModule.ConfigLoader string jsonFileName = jsonFile.name; Log.ConfigLoader.Info($"Loaded JSON Name:{jsonFileName} content: " + jsonFile.text); - +Debug.Log("0000000000000000000000000000001"); var destFilePath = Path.Combine(_configFolderPath, jsonFileName); File.WriteAllBytes(destFilePath, jsonFile.bytes); onComplete?.Invoke(true); - yield return null; // } // else { // Log.ConfigLoader.Error("Failed to load JSON file"); diff --git a/ProjectSettings/GvhProjectSettings.xml b/ProjectSettings/GvhProjectSettings.xml index 88f2c37..cf5bf78 100644 --- a/ProjectSettings/GvhProjectSettings.xml +++ b/ProjectSettings/GvhProjectSettings.xml @@ -1,5 +1,19 @@ + + + + + + + + + + + + + + \ No newline at end of file