pull/469/head
何冠峰 2025-02-11 09:55:38 +08:00
commit fa985a5a93
2 changed files with 12 additions and 8 deletions

View File

@ -34,24 +34,26 @@ internal class RecordWechatCacheFilesOperation : AsyncOperationBase
_steps = ESteps.WaitResponse;
var fileSystemMgr = _fileSystem.GetFileSystemMgr();
var getSavedFileListOption = new GetSavedFileListOption();
getSavedFileListOption.success = (GetSavedFileListSuccessCallbackResult response) =>
var statOption = new WXStatOption();
statOption.path = _fileSystem.FileRoot;
statOption.recursive = true;
statOption.success = (WXStatResponse response) =>
{
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
foreach (var fileInfo in response.fileList)
foreach (var fileStat in response.stats)
{
//TODO 需要确认存储文件为Bundle文件
_fileSystem.RecordBundleFile(fileInfo.filePath);
_fileSystem.RecordBundleFile(_fileSystem.FileRoot + fileStat.path);
}
};
getSavedFileListOption.fail = (FileError fileError) =>
statOption.fail = (WXStatResponse response) =>
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = fileError.errMsg;
Error = response.errMsg;
};
fileSystemMgr.GetSavedFileList(getSavedFileListOption);
fileSystemMgr.Stat(statOption);
}
}
}

View File

@ -62,6 +62,8 @@ internal class WechatFileSystem : IFileSystem
/// 包裹名称
/// </summary>
public string PackageName { private set; get; }
private readonly string _packageRoot = YooAssetSettingsData.Setting.DefaultYooFolderName;
/// <summary>
/// 文件根目录
@ -255,7 +257,7 @@ internal class WechatFileSystem : IFileSystem
{
if (_cacheFilePaths.TryGetValue(bundle.BundleGUID, out string filePath) == false)
{
filePath = PathUtility.Combine(_wxCacheRoot, bundle.FileName);
filePath = PathUtility.Combine(_wxCacheRoot, "__GAME_FILE_CACHE", _packageRoot, bundle.FileName);
_cacheFilePaths.Add(bundle.BundleGUID, filePath);
}
return filePath;