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)
{
SetFirstLaunch();
Debug.Log("000000000000000000000000000000");
FileNetworkManager.Instance.CopyStreamingAssetsToPersistentDataPath(result =>
{
Debug.Log("0000000000000000000000000000006");
var isSuccess = false;
if (result)
{
Debug.Log("0000000000000000000000000000007");
var names = FileNetworkManager.Instance.GetFileNamesFromPersistentDataPath(FileNetworkManager.FolderName);
if (names.Length > 0)
{
Debug.Log("0000000000000000000000000000008");
SetSavedConfigFileName(names[0]);
isSuccess = true;
}
@@ -50,7 +50,7 @@ namespace SGModule.ConfigLoader
{
Directory.CreateDirectory(_configFolderPath);
}
Debug.Log("0000000000000000000000000000002");
Debug.Log("0000000000000000000000000000002");
CopyFile(onComplete);
}
@@ -91,10 +91,12 @@ Debug.Log("0000000000000000000000000000002");
string jsonFileName = jsonFile.name;
Log.ConfigLoader.Info($"Loaded JSON Name:{jsonFileName} content: " + jsonFile.text);
Debug.Log("0000000000000000000000000000001");
Debug.Log("0000000000000000000000000000004");
var destFilePath = Path.Combine(_configFolderPath, jsonFileName);
File.WriteAllBytes(destFilePath, jsonFile.bytes);
Debug.Log("0000000000000000000000000000005");
onComplete?.Invoke(true);
// }
// else {
// Log.ConfigLoader.Error("Failed to load JSON file");