From fadc8e6fd63eea59f63f6d9ccb3f6cacb93a62f2 Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 8 Mar 2024 11:38:29 +0800 Subject: [PATCH] feat : add shader pack rule and filter rule --- .../DefaultRules/DefaultFilterRule.cs | 9 +++++++++ .../DefaultRules/DefaultPackRule.cs | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultFilterRule.cs b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultFilterRule.cs index 3befd04..e4f9be9 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultFilterRule.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultFilterRule.cs @@ -69,6 +69,15 @@ namespace YooAsset.Editor } } } + + [DisplayName("收集着色器")] + public class CollectShader : IFilterRule + { + public bool IsCollectAsset(FilterRuleData data) + { + return Path.GetExtension(data.AssetPath) == ".shader"; + } + } [DisplayName("收集着色器变种集合")] public class CollectShaderVariants : IFilterRule diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultPackRule.cs b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultPackRule.cs index f6633ed..80960a5 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultPackRule.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/DefaultRules/DefaultPackRule.cs @@ -147,6 +147,18 @@ namespace YooAsset.Editor } } + /// + /// 打包着色器 + /// + [DisplayName("打包着色器文件")] + public class PackShader : IPackRule + { + public PackRuleResult GetPackRuleResult(PackRuleData data) + { + return DefaultPackRule.CreateShadersPackRuleResult(); + } + } + /// /// 打包着色器变种集合 ///