This commit is contained in:
2026-06-12 15:35:46 +08:00
parent 0b64703422
commit c7d554be9f
2 changed files with 8 additions and 3 deletions
@@ -46,15 +46,18 @@ namespace SGModule.ConfigLoader
private void FirstLaunchCopyConfig(Action<bool> callback) private void FirstLaunchCopyConfig(Action<bool> callback)
{ {
SetFirstLaunch(); SetFirstLaunch();
Debug.Log("000000000000000000000000000000");
FileNetworkManager.Instance.CopyStreamingAssetsToPersistentDataPath(result => FileNetworkManager.Instance.CopyStreamingAssetsToPersistentDataPath(result =>
{ {
Debug.Log("0000000000000000000000000000006");
var isSuccess = false; var isSuccess = false;
if (result) if (result)
{ {
Debug.Log("0000000000000000000000000000007");
var names = FileNetworkManager.Instance.GetFileNamesFromPersistentDataPath(FileNetworkManager.FolderName); var names = FileNetworkManager.Instance.GetFileNamesFromPersistentDataPath(FileNetworkManager.FolderName);
if (names.Length > 0) if (names.Length > 0)
{ {
Debug.Log("0000000000000000000000000000008");
SetSavedConfigFileName(names[0]); SetSavedConfigFileName(names[0]);
isSuccess = true; isSuccess = true;
} }
@@ -50,7 +50,7 @@ namespace SGModule.ConfigLoader
{ {
Directory.CreateDirectory(_configFolderPath); Directory.CreateDirectory(_configFolderPath);
} }
Debug.Log("0000000000000000000000000000002"); Debug.Log("0000000000000000000000000000002");
CopyFile(onComplete); CopyFile(onComplete);
} }
@@ -91,10 +91,12 @@ Debug.Log("0000000000000000000000000000002");
string jsonFileName = jsonFile.name; string jsonFileName = jsonFile.name;
Log.ConfigLoader.Info($"Loaded JSON Name:{jsonFileName} content: " + jsonFile.text); Log.ConfigLoader.Info($"Loaded JSON Name:{jsonFileName} content: " + jsonFile.text);
Debug.Log("0000000000000000000000000000001"); Debug.Log("0000000000000000000000000000004");
var destFilePath = Path.Combine(_configFolderPath, jsonFileName); var destFilePath = Path.Combine(_configFolderPath, jsonFileName);
File.WriteAllBytes(destFilePath, jsonFile.bytes); File.WriteAllBytes(destFilePath, jsonFile.bytes);
Debug.Log("0000000000000000000000000000005");
onComplete?.Invoke(true); onComplete?.Invoke(true);
// } // }
// else { // else {
// Log.ConfigLoader.Error("Failed to load JSON file"); // Log.ConfigLoader.Error("Failed to load JSON file");