From 03d06ba657b1e1e5c5e984d7a07d0e92e63213a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E4=BC=BC=E9=94=A6?= <7997747+suxf@users.noreply.github.com> Date: Wed, 12 Feb 2025 00:29:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BE=AE=E4=BF=A1=E5=B0=8F?= =?UTF-8?q?=E6=B8=B8=E6=88=8F=E6=96=87=E4=BB=B6=E7=B3=BB=E7=BB=9F=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Operation/WXFSClearUnusedBundleFilesAsync.cs | 3 ++- .../ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSClearUnusedBundleFilesAsync.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSClearUnusedBundleFilesAsync.cs index 87b40f3a..0109a255 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSClearUnusedBundleFilesAsync.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSClearUnusedBundleFilesAsync.cs @@ -53,7 +53,8 @@ internal class WXFSClearUnusedBundleFilesAsync : FSClearCacheFilesOperation string bundleGUID = Path.GetFileNameWithoutExtension(fileStat.path); if (_manifest.TryGetPackageBundleByBundleGUID(bundleGUID, out PackageBundle value) == false) { - _unusedCacheFiles.Add(fileStat.path); + string fullPath = WX.GetCachePath(fileStat.path); + if (!_unusedCacheFiles.Contains(fullPath)) _unusedCacheFiles.Add(fullPath); } } 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 1220a8f8..ab3cbe59 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/WechatFileSystem.cs @@ -183,6 +183,11 @@ internal class WechatFileSystem : IFileSystem throw new System.Exception("请配置微信小游戏缓存根目录!"); } + if (!_wxCacheRoot.StartsWith(WX.PluginCachePath)) + { + _wxCacheRoot = PathUtility.Combine(WX.PluginCachePath, _wxCacheRoot); + } + // 注意:CDN服务未启用的情况下,使用微信WEB服务器 if (RemoteServices == null) {