From 41761f0a97b990dc89451569df1d302ae6216c1b Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 22 Jul 2022 12:56:22 +0800 Subject: [PATCH] Update AssetBundleBuilder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SBP构建参数增加了缓存服务器的地址和端口 --- .../Editor/AssetBundleBuilder/BuildParameters.cs | 10 ++++++++++ .../AssetBundleBuilder/BuildParametersContext.cs | 12 ++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs index 321ed84..6b47e1e 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs @@ -18,6 +18,16 @@ namespace YooAsset.Editor /// 生成代码防裁剪配置 /// public bool WriteLinkXML = true; + + /// + /// 缓存服务器地址 + /// + public string CacheServerHost; + + /// + /// 缓存服务器端口 + /// + public int CacheServerPort; } /// diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs index f856237..175d281 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs @@ -100,11 +100,19 @@ namespace YooAsset.Editor else throw new System.NotImplementedException(Parameters.CompressOption.ToString()); - if (Parameters.BuildMode == EBuildMode.ForceRebuild) - buildParams.UseCache = false; if (Parameters.DisableWriteTypeTree) buildParams.ContentBuildFlags |= UnityEditor.Build.Content.ContentBuildFlags.DisableWriteTypeTree; + if(Parameters.BuildMode == EBuildMode.ForceRebuild) + { + buildParams.UseCache = false; + } + else + { + buildParams.UseCache = true; + buildParams.CacheServerHost = Parameters.SBPParameters.CacheServerHost; + buildParams.CacheServerPort = Parameters.SBPParameters.CacheServerPort; + } buildParams.WriteLinkXML = Parameters.SBPParameters.WriteLinkXML; return buildParams;