mirror of https://github.com/tuyoogame/YooAsset
Merge branch 'dev' of https://github.com/tuyoogame/YooAsset into dev
commit
fa985a5a93
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue