This commit is contained in:
何冠峰
2025-08-28 10:40:13 +08:00
parent 6f34951a74
commit a4b1300195
2 changed files with 11 additions and 5 deletions

View File

@@ -12,6 +12,11 @@ namespace YooAsset.Editor
/// </summary> /// </summary>
public ECompressOption CompressOption = ECompressOption.Uncompressed; public ECompressOption CompressOption = ECompressOption.Uncompressed;
/// <summary>
/// 从文件头里剥离Unity版本信息
/// </summary>
public bool StripUnityVersion = false;
/// <summary> /// <summary>
/// 禁止写入类型树结构(可以降低包体和内存并提高加载效率) /// 禁止写入类型树结构(可以降低包体和内存并提高加载效率)
/// </summary> /// </summary>
@@ -41,6 +46,8 @@ namespace YooAsset.Editor
if (ClearBuildCacheFiles) if (ClearBuildCacheFiles)
opt |= BuildAssetBundleOptions.ForceRebuildAssetBundle; //Force rebuild the asset bundles opt |= BuildAssetBundleOptions.ForceRebuildAssetBundle; //Force rebuild the asset bundles
if (StripUnityVersion)
opt |= BuildAssetBundleOptions.AssetBundleStripUnityVersion; //Removes the Unity Version number in the Archive File & Serialized File headers
if (DisableWriteTypeTree) if (DisableWriteTypeTree)
opt |= BuildAssetBundleOptions.DisableWriteTypeTree; //Do not include type information within the asset bundle (don't write type tree). opt |= BuildAssetBundleOptions.DisableWriteTypeTree; //Do not include type information within the asset bundle (don't write type tree).
if (IgnoreTypeTreeChanges) if (IgnoreTypeTreeChanges)

View File

@@ -15,7 +15,7 @@ namespace YooAsset.Editor
public ECompressOption CompressOption = ECompressOption.Uncompressed; public ECompressOption CompressOption = ECompressOption.Uncompressed;
/// <summary> /// <summary>
/// 从AssetBundle文件头里剥离Unity版本信息 /// 从文件头里剥离Unity版本信息
/// </summary> /// </summary>
public bool StripUnityVersion = false; public bool StripUnityVersion = false;
@@ -25,7 +25,7 @@ namespace YooAsset.Editor
public bool DisableWriteTypeTree = false; public bool DisableWriteTypeTree = false;
/// <summary> /// <summary>
/// 忽略类型树变化 /// 忽略类型树变化(无效参数)
/// </summary> /// </summary>
public bool IgnoreTypeTreeChanges = true; public bool IgnoreTypeTreeChanges = true;
@@ -76,10 +76,9 @@ namespace YooAsset.Editor
throw new System.NotImplementedException(CompressOption.ToString()); throw new System.NotImplementedException(CompressOption.ToString());
if (StripUnityVersion) if (StripUnityVersion)
buildParams.ContentBuildFlags |= UnityEditor.Build.Content.ContentBuildFlags.StripUnityVersion; buildParams.ContentBuildFlags |= UnityEditor.Build.Content.ContentBuildFlags.StripUnityVersion; // Build Flag to indicate the Unity Version should not be written to the serialized file.
if (DisableWriteTypeTree) if (DisableWriteTypeTree)
buildParams.ContentBuildFlags |= UnityEditor.Build.Content.ContentBuildFlags.DisableWriteTypeTree; buildParams.ContentBuildFlags |= UnityEditor.Build.Content.ContentBuildFlags.DisableWriteTypeTree; //Do not include type information within the built content.
buildParams.UseCache = true; buildParams.UseCache = true;
buildParams.CacheServerHost = CacheServerHost; buildParams.CacheServerHost = CacheServerHost;