diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs index 5944376..194ee24 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs @@ -28,6 +28,7 @@ namespace YooAsset.Editor // 创建新补丁清单 PatchManifest patchManifest = new PatchManifest(); + patchManifest.FileVersion = YooAssetSettings.PatchManifestFileVersion; patchManifest.ResourceVersion = buildParameters.Parameters.BuildVersion; patchManifest.EnableAddressable = buildParameters.Parameters.EnableAddressable; patchManifest.OutputNameStyle = (int)buildParameters.Parameters.OutputNameStyle; diff --git a/Assets/YooAsset/Runtime/PatchSystem/PatchManifest.cs b/Assets/YooAsset/Runtime/PatchSystem/PatchManifest.cs index b638d7e..ea18152 100644 --- a/Assets/YooAsset/Runtime/PatchSystem/PatchManifest.cs +++ b/Assets/YooAsset/Runtime/PatchSystem/PatchManifest.cs @@ -12,6 +12,11 @@ namespace YooAsset [Serializable] internal class PatchManifest { + /// + /// 文件版本 + /// + public string FileVersion; + /// /// 资源版本号 /// @@ -229,6 +234,10 @@ namespace YooAsset { PatchManifest patchManifest = JsonUtility.FromJson(jsonData); + // 检测文件版本 + if (patchManifest.FileVersion != YooAssetSettings.PatchManifestFileVersion) + throw new Exception($"The manifest file version are not compatible : {patchManifest.FileVersion} != {YooAssetSettings.PatchManifestFileVersion}"); + // BundleList foreach (var patchBundle in patchManifest.BundleList) { diff --git a/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs b/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs index 89ad779..d3828a7 100644 --- a/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs +++ b/Assets/YooAsset/Runtime/Settings/YooAssetSettings.cs @@ -16,11 +16,16 @@ namespace YooAsset public string RawFileVariant = "rawfile"; /// - /// 构建输出的补丁清单文件名称 + /// 补丁清单文件名称 /// public string PatchManifestFileName = "PatchManifest"; + /// + /// 补丁清单文件版本 + /// + public const string PatchManifestFileVersion = "1.2.2"; + /// /// 构建输出文件夹名称 ///