From abb75fe8583abb7e5aabb0b3c5897cdc4f1c91a4 Mon Sep 17 00:00:00 2001 From: hevinci Date: Mon, 18 Apr 2022 09:58:44 +0800 Subject: [PATCH] Fixed a process error raised after the additional version of the patch manifest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复资源清单附加版本之后引发的一个流程错误。 --- .../Operations/UpdateManifestOperation.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Runtime/PatchSystem/Operations/UpdateManifestOperation.cs b/Assets/YooAsset/Runtime/PatchSystem/Operations/UpdateManifestOperation.cs index 45773ab..32a8127 100644 --- a/Assets/YooAsset/Runtime/PatchSystem/Operations/UpdateManifestOperation.cs +++ b/Assets/YooAsset/Runtime/PatchSystem/Operations/UpdateManifestOperation.cs @@ -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 } } + /// + /// 加载沙盒内的补丁清单 + /// + 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); + } + /// /// 获取沙盒内补丁清单文件的哈希值 /// 注意:如果沙盒内补丁清单文件不存在,返回空字符串