diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs index 2358427..9abe437 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs @@ -20,13 +20,19 @@ namespace YooAsset.Editor // 检测构建参数是否为空 if (buildParameters == null) - { throw new Exception($"{nameof(buildParameters)} is null !"); - } + + // 检测可编程构建管线参数 if (buildParameters.BuildPipeline == EBuildPipeline.ScriptableBuildPipeline) { if (buildParameters.SBPParameters == null) throw new Exception($"{nameof(BuildParameters.SBPParameters)} is null !"); + + if (buildParameters.BuildMode == EBuildMode.DryRunBuild) + throw new Exception($"{nameof(EBuildPipeline.ScriptableBuildPipeline)} not support {nameof(EBuildMode.DryRunBuild)} build mode !"); + + if (buildParameters.BuildMode == EBuildMode.ForceRebuild) + throw new Exception($"{nameof(EBuildPipeline.ScriptableBuildPipeline)} not support {nameof(EBuildMode.ForceRebuild)} build mode !"); } // 构建参数 diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs index 175d281..e06d7fc 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs @@ -85,9 +85,6 @@ namespace YooAsset.Editor if (Parameters.BuildMode == EBuildMode.SimulateBuild) throw new Exception("Should never get here !"); - if (Parameters.BuildMode == EBuildMode.DryRunBuild) - throw new Exception($"SBP not support {nameof(EBuildMode.DryRunBuild)} build mode !"); - var targetGroup = BuildPipeline.GetBuildTargetGroup(Parameters.BuildTarget); var buildParams = new UnityEditor.Build.Pipeline.BundleBuildParameters(Parameters.BuildTarget, targetGroup, PipelineOutputDirectory); @@ -103,16 +100,9 @@ namespace YooAsset.Editor 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.UseCache = true; + buildParams.CacheServerHost = Parameters.SBPParameters.CacheServerHost; + buildParams.CacheServerPort = Parameters.SBPParameters.CacheServerPort; buildParams.WriteLinkXML = Parameters.SBPParameters.WriteLinkXML; return buildParams;