Fixed a process error raised after the additional version of the patch manifest

修复资源清单附加版本之后引发的一个流程错误。
pull/4/head
hevinci 2022-04-18 09:58:44 +08:00
parent 4591d0b5f6
commit abb75fe858
1 changed files with 13 additions and 1 deletions

View File

@ -113,6 +113,7 @@ namespace YooAsset
if (cachedManifestHash == webManifestHash)
{
YooLogger.Log($"Patch manifest file hash is not change : {webManifestHash}");
LoadSandboxPatchManifest(_updateResourceVersion);
_steps = ESteps.InitPrepareCache;
}
else
@ -140,7 +141,7 @@ namespace YooAsset
// Check error
if (_downloaderManifest.HasError())
{
{
_steps = ESteps.Done;
Status = EOperationStatus.Failed;
Error = _downloaderManifest.GetError();
@ -211,6 +212,17 @@ namespace YooAsset
}
}
/// <summary>
/// 加载沙盒内的补丁清单
/// </summary>
private void LoadSandboxPatchManifest(int updateResourceVersion)
{
YooLogger.Log("Load sandbox patch manifest file.");
string filePath = PathHelper.MakePersistentLoadPath(YooAssetSettingsData.GetPatchManifestFileName(updateResourceVersion));
string jsonData = File.ReadAllText(filePath);
_impl.LocalPatchManifest = PatchManifest.Deserialize(jsonData);
}
/// <summary>
/// 获取沙盒内补丁清单文件的哈希值
/// 注意:如果沙盒内补丁清单文件不存在,返回空字符串