From 2384921477aab9781ed2164c224ee95ec6913187 Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 8 Mar 2023 19:39:20 +0800 Subject: [PATCH] update asset bundle builder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了可编程构建管线,当项目里没有着色器,如果有引用内置着色器会导致打包失败的问题。 --- .../BuildTasks/TaskBuilding_SBP.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs index 80ce01f..d7ef3e0 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs @@ -40,6 +40,19 @@ namespace YooAsset.Editor throw new Exception($"构建过程中发生错误 : {exitCode}"); } + // 着色器适配 + // 说明:解决因为着色器资源包导致验证失败。 + // 例如:当项目里没有着色器,如果有依赖内置着色器就会验证失败。 + string shadersBundleName = buildMapContext.ShadersBundleName; + if (buildResults.BundleInfos.ContainsKey(shadersBundleName)) + { + if (buildMapContext.IsContainsBundle(shadersBundleName) == false) + { + var shaderBundleInfo = new BuildBundleInfo(shadersBundleName); + buildMapContext.BundleInfos.Add(shaderBundleInfo); + } + } + BuildLogger.Log("Unity引擎打包成功!"); BuildResultContext buildResultContext = new BuildResultContext(); buildResultContext.Results = buildResults;