From aac315826ee64d028df73a518664f3064439ba75 Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 7 Apr 2023 16:07:24 +0800 Subject: [PATCH] update asset bundle collector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复了通过代码途径导入XML配置的报错问题。 --- .../AssetBundleCollectorSettingData.cs | 41 ++++++------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs index 5152534..5fd5aee 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorSettingData.cs @@ -27,24 +27,8 @@ namespace YooAsset.Editor public static bool IsDirty { private set; get; } = false; - private static AssetBundleCollectorSetting _setting = null; - public static AssetBundleCollectorSetting Setting + static AssetBundleCollectorSettingData() { - get - { - if (_setting == null) - LoadSettingData(); - return _setting; - } - } - - /// - /// 加载配置文件 - /// - private static void LoadSettingData() - { - _setting = SettingLoader.LoadSettingData(); - // IPackRule { // 清空缓存集合 @@ -147,6 +131,17 @@ namespace YooAsset.Editor } } + private static AssetBundleCollectorSetting _setting = null; + public static AssetBundleCollectorSetting Setting + { + get + { + if (_setting == null) + _setting = SettingLoader.LoadSettingData(); + return _setting; + } + } + /// /// 存储配置文件 /// @@ -184,9 +179,6 @@ namespace YooAsset.Editor public static List GetActiveRuleNames() { - if (_setting == null) - LoadSettingData(); - List names = new List(); foreach (var pair in _cacheActiveRuleTypes) { @@ -199,9 +191,6 @@ namespace YooAsset.Editor } public static List GetAddressRuleNames() { - if (_setting == null) - LoadSettingData(); - List names = new List(); foreach (var pair in _cacheAddressRuleTypes) { @@ -214,9 +203,6 @@ namespace YooAsset.Editor } public static List GetPackRuleNames() { - if (_setting == null) - LoadSettingData(); - List names = new List(); foreach (var pair in _cachePackRuleTypes) { @@ -229,9 +215,6 @@ namespace YooAsset.Editor } public static List GetFilterRuleNames() { - if (_setting == null) - LoadSettingData(); - List names = new List(); foreach (var pair in _cacheFilterRuleTypes) {