mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-21 07:50:20 +00:00
feat : wechat game cache query
This commit is contained in:
@@ -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<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
if (IsCachedPackageBundle(packageBundle))
|
||||
continue;
|
||||
|
||||
// 忽略APP资源
|
||||
if (IsBuildinPackageBundle(packageBundle))
|
||||
continue;
|
||||
@@ -137,6 +158,10 @@ namespace YooAsset
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
foreach (var packageBundle in manifest.BundleList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
if (IsCachedPackageBundle(packageBundle))
|
||||
continue;
|
||||
|
||||
// 忽略APP资源
|
||||
if (IsBuildinPackageBundle(packageBundle))
|
||||
continue;
|
||||
@@ -194,6 +219,10 @@ namespace YooAsset
|
||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||
foreach (var packageBundle in checkList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
if (IsCachedPackageBundle(packageBundle))
|
||||
continue;
|
||||
|
||||
// 忽略APP资源
|
||||
if (IsBuildinPackageBundle(packageBundle))
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user