fix:1、修复bug
This commit is contained in:
@@ -216,27 +216,27 @@ public class TextureHelper
|
||||
public static string getResPath()
|
||||
{
|
||||
// 删除旧资源
|
||||
if (!DataMgr.curResVersion.Value.IsNullOrWhiteSpace() && DataMgr.curResVersion.Value != ConfigSystem.GetCommonConf().ResVersion)
|
||||
if (!DataMgr.curResVersion.Value.IsNullOrWhiteSpace() && DataMgr.curResVersion.Value != ConfigSystem.GetConfigResVersion())
|
||||
{
|
||||
var oldFolder = Path.Combine(Application.persistentDataPath, DataMgr.curResVersion.Value);
|
||||
if (Directory.Exists(oldFolder))
|
||||
{
|
||||
Directory.Delete(oldFolder, true);
|
||||
}
|
||||
DataMgr.curResVersion.Value = ConfigSystem.GetCommonConf().ResVersion;
|
||||
DataMgr.curResVersion.Value = ConfigSystem.GetConfigResVersion();
|
||||
}
|
||||
else if (DataMgr.curResVersion.Value.IsNullOrWhiteSpace())
|
||||
{
|
||||
DataMgr.curResVersion.Value = ConfigSystem.GetCommonConf().ResVersion;
|
||||
DataMgr.curResVersion.Value = ConfigSystem.GetConfigResVersion();
|
||||
}
|
||||
|
||||
if (ConfigSystem.GetCommonConf().ResVersion.IsNullOrWhiteSpace())
|
||||
if (ConfigSystem.GetConfigResVersion().IsNullOrWhiteSpace())
|
||||
{
|
||||
Debug.LogError("获取资源路径失败");
|
||||
return Application.persistentDataPath;
|
||||
}
|
||||
|
||||
string curFolder = Path.Combine(Application.persistentDataPath, ConfigSystem.GetCommonConf().ResVersion);
|
||||
string curFolder = Path.Combine(Application.persistentDataPath, ConfigSystem.GetConfigResVersion());
|
||||
return curFolder;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ public class TextureHelper
|
||||
var localPath = Path.Combine(getResPath(), localFolder, fileName + ".jpg");
|
||||
if (File.Exists(localPath))
|
||||
{
|
||||
Debug.Log($"[SetImgLoader] 本地存在,直接加载 {fileName}");
|
||||
Debug.Log($"[SetImgLoader] 本地存在,直接加载 {fileName} localPath:{localPath}");
|
||||
CrazyAsyKit.StartCoroutine(LoadTexture(fileName, loader, callback, localFolder, isGameBg));
|
||||
return;
|
||||
}
|
||||
@@ -512,6 +512,7 @@ public static IEnumerator LoadTexture(string fileName, GLoader loader, Action<NT
|
||||
|
||||
if (loader != null) loaderRequests.Remove(loader);
|
||||
|
||||
Debug.Log($"[LoadTexture www] www.result {www.result}");
|
||||
if (www.result == UnityWebRequest.Result.Success)
|
||||
{
|
||||
var tex = DownloadHandlerTexture.GetContent(www);
|
||||
@@ -559,7 +560,7 @@ public static IEnumerator LoadTexture(string fileName, GLoader loader, Action<NT
|
||||
public static string GetDecryptedImagePath(string fileName, string localFolder)
|
||||
{
|
||||
string tempPath = Path.Combine(Application.temporaryCachePath, FolderNames.GameCache, localFolder, fileName + "_temp.jpg");
|
||||
// Debug.Log($"获取解密路径: {tempPath}");
|
||||
Debug.Log($"获取解密路径: {tempPath}");
|
||||
|
||||
if (!File.Exists(tempPath))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user