mirror of https://github.com/tuyoogame/YooAsset
feat : wechat game cache query
parent
1fb78185ff
commit
95328fe1a6
|
@ -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)
|
private bool IsBuildinPackageBundle(PackageBundle packageBundle)
|
||||||
{
|
{
|
||||||
return _buildinQueryServices.Query(PackageName, packageBundle.FileName, packageBundle.FileCRC);
|
return _buildinQueryServices.Query(PackageName, packageBundle.FileName, packageBundle.FileCRC);
|
||||||
|
@ -116,6 +133,10 @@ namespace YooAsset
|
||||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||||
foreach (var packageBundle in manifest.BundleList)
|
foreach (var packageBundle in manifest.BundleList)
|
||||||
{
|
{
|
||||||
|
// 忽略缓存文件
|
||||||
|
if (IsCachedPackageBundle(packageBundle))
|
||||||
|
continue;
|
||||||
|
|
||||||
// 忽略APP资源
|
// 忽略APP资源
|
||||||
if (IsBuildinPackageBundle(packageBundle))
|
if (IsBuildinPackageBundle(packageBundle))
|
||||||
continue;
|
continue;
|
||||||
|
@ -137,6 +158,10 @@ namespace YooAsset
|
||||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||||
foreach (var packageBundle in manifest.BundleList)
|
foreach (var packageBundle in manifest.BundleList)
|
||||||
{
|
{
|
||||||
|
// 忽略缓存文件
|
||||||
|
if (IsCachedPackageBundle(packageBundle))
|
||||||
|
continue;
|
||||||
|
|
||||||
// 忽略APP资源
|
// 忽略APP资源
|
||||||
if (IsBuildinPackageBundle(packageBundle))
|
if (IsBuildinPackageBundle(packageBundle))
|
||||||
continue;
|
continue;
|
||||||
|
@ -194,6 +219,10 @@ namespace YooAsset
|
||||||
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
List<PackageBundle> downloadList = new List<PackageBundle>(1000);
|
||||||
foreach (var packageBundle in checkList)
|
foreach (var packageBundle in checkList)
|
||||||
{
|
{
|
||||||
|
// 忽略缓存文件
|
||||||
|
if (IsCachedPackageBundle(packageBundle))
|
||||||
|
continue;
|
||||||
|
|
||||||
// 忽略APP资源
|
// 忽略APP资源
|
||||||
if (IsBuildinPackageBundle(packageBundle))
|
if (IsBuildinPackageBundle(packageBundle))
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue