diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/internal/RecordWechatCacheFilesOperation.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/internal/RecordWechatCacheFilesOperation.cs index d05c34db..45d39b98 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/internal/RecordWechatCacheFilesOperation.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/internal/RecordWechatCacheFilesOperation.cs @@ -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); } } } diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs index c1059b22..2c72df3d 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs @@ -62,6 +62,8 @@ internal class WechatFileSystem : IFileSystem /// 包裹名称 /// public string PackageName { private set; get; } + + private readonly string _packageRoot = YooAssetSettingsData.Setting.DefaultYooFolderName; /// /// 文件根目录 @@ -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;