mirror of https://github.com/tuyoogame/YooAsset
parent
4e257ab27d
commit
009e8ece79
|
@ -40,6 +40,7 @@ internal class WXFSClearUnusedBundleFilesAsync : FSClearCacheFilesOperation
|
|||
{
|
||||
_steps = ESteps.WaitingSearch;
|
||||
|
||||
// 说明:__GAME_FILE_CACHE/yoo/ 目录下包含所有的资源文件和清单文件
|
||||
var fileSystemMgr = _fileSystem.GetFileSystemMgr();
|
||||
var statOption = new WXStatOption();
|
||||
statOption.path = _fileSystem.FileRoot;
|
||||
|
@ -48,14 +49,24 @@ internal class WXFSClearUnusedBundleFilesAsync : FSClearCacheFilesOperation
|
|||
{
|
||||
foreach (var fileStat in response.stats)
|
||||
{
|
||||
// 如果是目录文件
|
||||
string fileExtension = Path.GetExtension(fileStat.path);
|
||||
if (string.IsNullOrEmpty(fileExtension))
|
||||
continue;
|
||||
|
||||
// 如果是资源清单
|
||||
//TODO 默认的清单文件格式
|
||||
if (fileExtension == ".bytes" || fileExtension == ".hash")
|
||||
continue;
|
||||
|
||||
// 注意:适配不同的文件命名方式!
|
||||
string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(fileStat.path);
|
||||
string bundleGUID = fileNameWithoutExtension.Split('_').Last();
|
||||
if (_manifest.TryGetPackageBundleByBundleGUID(bundleGUID, out PackageBundle value) == false)
|
||||
{
|
||||
string fullPath = WX.GetCachePath(fileStat.path);
|
||||
if (_unusedCacheFiles.Contains(fullPath) == false)
|
||||
_unusedCacheFiles.Add(fullPath);
|
||||
string filePath = _fileSystem.FileRoot + fileStat.path;
|
||||
if (_unusedCacheFiles.Contains(filePath) == false)
|
||||
_unusedCacheFiles.Add(filePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -191,11 +191,6 @@ internal class WechatFileSystem : IFileSystem
|
|||
throw new System.Exception("请配置微信小游戏缓存根目录!");
|
||||
}
|
||||
|
||||
if (_wxCacheRoot.StartsWith(WX.PluginCachePath) == false)
|
||||
{
|
||||
_wxCacheRoot = PathUtility.Combine(WX.PluginCachePath, _wxCacheRoot);
|
||||
}
|
||||
|
||||
// 注意:CDN服务未启用的情况下,使用微信WEB服务器
|
||||
if (RemoteServices == null)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue