Update PatchManifest

资源补丁清单增加文件版本信息
pull/31/head
hevinci 2022-07-31 23:09:54 +08:00
parent f80a3229cc
commit 2204f4d129
3 changed files with 16 additions and 1 deletions

View File

@ -28,6 +28,7 @@ namespace YooAsset.Editor
// 创建新补丁清单 // 创建新补丁清单
PatchManifest patchManifest = new PatchManifest(); PatchManifest patchManifest = new PatchManifest();
patchManifest.FileVersion = YooAssetSettings.PatchManifestFileVersion;
patchManifest.ResourceVersion = buildParameters.Parameters.BuildVersion; patchManifest.ResourceVersion = buildParameters.Parameters.BuildVersion;
patchManifest.EnableAddressable = buildParameters.Parameters.EnableAddressable; patchManifest.EnableAddressable = buildParameters.Parameters.EnableAddressable;
patchManifest.OutputNameStyle = (int)buildParameters.Parameters.OutputNameStyle; patchManifest.OutputNameStyle = (int)buildParameters.Parameters.OutputNameStyle;

View File

@ -12,6 +12,11 @@ namespace YooAsset
[Serializable] [Serializable]
internal class PatchManifest internal class PatchManifest
{ {
/// <summary>
/// 文件版本
/// </summary>
public string FileVersion;
/// <summary> /// <summary>
/// 资源版本号 /// 资源版本号
/// </summary> /// </summary>
@ -229,6 +234,10 @@ namespace YooAsset
{ {
PatchManifest patchManifest = JsonUtility.FromJson<PatchManifest>(jsonData); PatchManifest patchManifest = JsonUtility.FromJson<PatchManifest>(jsonData);
// 检测文件版本
if (patchManifest.FileVersion != YooAssetSettings.PatchManifestFileVersion)
throw new Exception($"The manifest file version are not compatible : {patchManifest.FileVersion} != {YooAssetSettings.PatchManifestFileVersion}");
// BundleList // BundleList
foreach (var patchBundle in patchManifest.BundleList) foreach (var patchBundle in patchManifest.BundleList)
{ {

View File

@ -16,11 +16,16 @@ namespace YooAsset
public string RawFileVariant = "rawfile"; public string RawFileVariant = "rawfile";
/// <summary> /// <summary>
/// 构建输出的补丁清单文件名称 /// 补丁清单文件名称
/// </summary> /// </summary>
public string PatchManifestFileName = "PatchManifest"; public string PatchManifestFileName = "PatchManifest";
/// <summary>
/// 补丁清单文件版本
/// </summary>
public const string PatchManifestFileVersion = "1.2.2";
/// <summary> /// <summary>
/// 构建输出文件夹名称 /// 构建输出文件夹名称
/// </summary> /// </summary>