mirror of
https://github.com/tuyoogame/YooAsset.git
synced 2026-05-23 09:10:11 +00:00
Update CacheSystem
修复原生文件每次获取都重复拷贝的问题
This commit is contained in:
@@ -288,6 +288,38 @@ namespace YooAsset
|
||||
return bundleInfo;
|
||||
}
|
||||
|
||||
internal List<VerifyInfo> GetVerifyInfoList(bool weaklyUpdateMode)
|
||||
{
|
||||
List<VerifyInfo> result = new List<VerifyInfo>(LocalPatchManifest.BundleList.Count);
|
||||
|
||||
// 遍历所有文件然后验证并缓存合法文件
|
||||
foreach (var patchBundle in LocalPatchManifest.BundleList)
|
||||
{
|
||||
// 忽略缓存文件
|
||||
if (CacheSystem.IsCached(patchBundle))
|
||||
continue;
|
||||
|
||||
// 注意:在弱联网模式下,我们需要验证指定资源版本的所有资源完整性
|
||||
if (weaklyUpdateMode)
|
||||
{
|
||||
bool isBuildinFile = IsBuildinPatchBundle(patchBundle);
|
||||
VerifyInfo verifyInfo = new VerifyInfo(isBuildinFile, patchBundle);
|
||||
result.Add(verifyInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
string filePath = patchBundle.CachedFilePath;
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
bool isBuildinFile = IsBuildinPatchBundle(patchBundle);
|
||||
VerifyInfo verifyInfo = new VerifyInfo(isBuildinFile, patchBundle);
|
||||
result.Add(verifyInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
internal void SetLocalPatchManifest(PatchManifest patchManifest)
|
||||
{
|
||||
LocalPatchManifest = patchManifest;
|
||||
|
||||
Reference in New Issue
Block a user