diff --git a/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/WebPlayModeImpl.cs b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/WebPlayModeImpl.cs index f5cf33b..afdc525 100644 --- a/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/WebPlayModeImpl.cs +++ b/Assets/YooAsset/Runtime/ResourcePackage/PlayMode/WebPlayModeImpl.cs @@ -65,6 +65,23 @@ namespace YooAsset } // 查询相关 +#if UNITY_WX_GAME + private WeChatWASM.WXFileSystemManager _wxFileSystemMgr; + private bool IsCachedPackageBundle(PackageBundle packageBundle) + { + if (_wxFileSystemMgr == null) + _wxFileSystemMgr = WeChatWASM.WX.GetFileSystemManager(); + string filePath = WeChatWASM.WX.env.USER_DATA_PATH + packageBundle.FileName; + string result = _wxFileSystemMgr.AccessSync(filePath); + return result.Equals("access:ok"); + } +#else + private bool IsCachedPackageBundle(PackageBundle packageBundle) + { + return false; + } +#endif + private bool IsBuildinPackageBundle(PackageBundle packageBundle) { return _buildinQueryServices.Query(PackageName, packageBundle.FileName, packageBundle.FileCRC); @@ -116,6 +133,10 @@ namespace YooAsset List downloadList = new List(1000); foreach (var packageBundle in manifest.BundleList) { + // 忽略缓存文件 + if (IsCachedPackageBundle(packageBundle)) + continue; + // 忽略APP资源 if (IsBuildinPackageBundle(packageBundle)) continue; @@ -137,6 +158,10 @@ namespace YooAsset List downloadList = new List(1000); foreach (var packageBundle in manifest.BundleList) { + // 忽略缓存文件 + if (IsCachedPackageBundle(packageBundle)) + continue; + // 忽略APP资源 if (IsBuildinPackageBundle(packageBundle)) continue; @@ -194,6 +219,10 @@ namespace YooAsset List downloadList = new List(1000); foreach (var packageBundle in checkList) { + // 忽略缓存文件 + if (IsCachedPackageBundle(packageBundle)) + continue; + // 忽略APP资源 if (IsBuildinPackageBundle(packageBundle)) continue;