diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildMapContext.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildMapContext.cs
index 98e992f..55633f4 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildMapContext.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildMapContext.cs
@@ -59,31 +59,6 @@ namespace YooAsset.Editor
}
}
- ///
- /// 获取所有的打包资源
- ///
- public List GetAllAssets()
- {
- List result = new List(BundleInfos.Count);
- foreach (var bundleInfo in BundleInfos)
- {
- result.AddRange(bundleInfo.BuildinAssets);
- }
- return result;
- }
-
- ///
- /// 获取AssetBundle内构建的资源路径列表
- ///
- public string[] GetBuildinAssetPaths(string bundleName)
- {
- if (_bundleInfoDic.TryGetValue(bundleName, out BuildBundleInfo bundleInfo))
- {
- return bundleInfo.GetBuildinAssetPaths();
- }
- throw new Exception($"Not found {nameof(BuildBundleInfo)} : {bundleName}");
- }
-
///
/// 获取构建管线里需要的数据
///
@@ -117,5 +92,18 @@ namespace YooAsset.Editor
}
throw new Exception($"Not found bundle : {bundleName}");
}
+
+ ///
+ /// 创建着色器信息类
+ ///
+ public void CreateShadersBundleInfo(string shadersBundleName)
+ {
+ if (IsContainsBundle(shadersBundleName) == false)
+ {
+ var shaderBundleInfo = new BuildBundleInfo(shadersBundleName);
+ BundleInfos.Add(shaderBundleInfo);
+ _bundleInfoDic.Add(shadersBundleName, shaderBundleInfo);
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs
index d7ef3e0..bb69ae2 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskBuilding_SBP.cs
@@ -40,17 +40,13 @@ 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);
- }
+ buildMapContext.CreateShadersBundleInfo(shadersBundleName);
}
BuildLogger.Log("Unity引擎打包成功!");