From 5a01ca061ae011ce50b24a89b424df3343f2740d Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 10 Feb 2023 17:41:08 +0800 Subject: [PATCH] update AssetBundleBuilder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit unity2021开始不再支持内置构建管线。 --- .../Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs index 718cfbb..297620c 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs @@ -16,12 +16,17 @@ namespace YooAsset.Editor var buildParameters = buildParametersContext.Parameters; +#if !UNITY_2021_1_OR_NEWER + if (buildParameters.BuildPipeline == EBuildPipeline.BuiltinBuildPipeline) + throw new Exception($"Unity2021 or newer not support {nameof(EBuildPipeline.BuiltinBuildPipeline)}, Please use {nameof(EBuildPipeline.ScriptableBuildPipeline)}"); +#endif + // 检测构建参数合法性 if (buildParameters.BuildTarget == BuildTarget.NoTarget) throw new Exception("请选择目标平台"); if (string.IsNullOrEmpty(buildParameters.PackageName)) throw new Exception("包裹名称不能为空"); - if(string.IsNullOrEmpty(buildParameters.PackageVersion)) + if (string.IsNullOrEmpty(buildParameters.PackageVersion)) throw new Exception("包裹版本不能为空"); if (buildParameters.BuildMode != EBuildMode.SimulateBuild)