From 8b8f44d2a8228d84385fbf49a33d0b94201a609f Mon Sep 17 00:00:00 2001 From: hevinci Date: Tue, 2 Aug 2022 14:30:25 +0800 Subject: [PATCH] Update AssetBundleBuilder --- .../AssetBundleCollectorSetting.cs | 28 +++++++++++++++++++ .../AssetBundleCollectorSettingData.cs | 9 ++++++ 2 files changed, 37 insertions(+) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSetting.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSetting.cs index d23c992..853a450 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSetting.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSetting.cs @@ -40,6 +40,34 @@ namespace YooAsset.Editor } } + /// + /// 获取所有的资源标签 + /// + public List GetAllTags() + { + HashSet result = new HashSet(); + foreach (var group in Groups) + { + List groupTags = StringUtility.StringToStringList(group.AssetTags, ';'); + foreach (var tag in groupTags) + { + if (result.Contains(tag) == false) + result.Add(tag); + } + + foreach (var collector in group.Collectors) + { + List collectorTags = StringUtility.StringToStringList(collector.AssetTags, ';'); + foreach (var tag in collectorTags) + { + if (result.Contains(tag) == false) + result.Add(tag); + } + } + } + return result.ToList(); + } + /// /// 获取打包收集的资源文件 /// diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs index 29e851d..6bc94aa 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs @@ -394,5 +394,14 @@ namespace YooAsset.Editor IsDirty = true; } } + + /// + /// 获取所有的资源标签 + /// + public static string GetAllTags() + { + var allTgas = Setting.GetAllTags(); + return string.Join(";", allTgas); + } } } \ No newline at end of file