update asset bundle collector

修复了通过代码途径导入XML配置的报错问题。
pull/98/head^2
hevinci 2023-04-07 16:07:24 +08:00
parent 567c34d4d1
commit aac315826e
1 changed files with 12 additions and 29 deletions

View File

@ -27,24 +27,8 @@ namespace YooAsset.Editor
public static bool IsDirty { private set; get; } = false; public static bool IsDirty { private set; get; } = false;
private static AssetBundleCollectorSetting _setting = null; static AssetBundleCollectorSettingData()
public static AssetBundleCollectorSetting Setting
{ {
get
{
if (_setting == null)
LoadSettingData();
return _setting;
}
}
/// <summary>
/// 加载配置文件
/// </summary>
private static void LoadSettingData()
{
_setting = SettingLoader.LoadSettingData<AssetBundleCollectorSetting>();
// IPackRule // IPackRule
{ {
// 清空缓存集合 // 清空缓存集合
@ -147,6 +131,17 @@ namespace YooAsset.Editor
} }
} }
private static AssetBundleCollectorSetting _setting = null;
public static AssetBundleCollectorSetting Setting
{
get
{
if (_setting == null)
_setting = SettingLoader.LoadSettingData<AssetBundleCollectorSetting>();
return _setting;
}
}
/// <summary> /// <summary>
/// 存储配置文件 /// 存储配置文件
/// </summary> /// </summary>
@ -184,9 +179,6 @@ namespace YooAsset.Editor
public static List<RuleDisplayName> GetActiveRuleNames() public static List<RuleDisplayName> GetActiveRuleNames()
{ {
if (_setting == null)
LoadSettingData();
List<RuleDisplayName> names = new List<RuleDisplayName>(); List<RuleDisplayName> names = new List<RuleDisplayName>();
foreach (var pair in _cacheActiveRuleTypes) foreach (var pair in _cacheActiveRuleTypes)
{ {
@ -199,9 +191,6 @@ namespace YooAsset.Editor
} }
public static List<RuleDisplayName> GetAddressRuleNames() public static List<RuleDisplayName> GetAddressRuleNames()
{ {
if (_setting == null)
LoadSettingData();
List<RuleDisplayName> names = new List<RuleDisplayName>(); List<RuleDisplayName> names = new List<RuleDisplayName>();
foreach (var pair in _cacheAddressRuleTypes) foreach (var pair in _cacheAddressRuleTypes)
{ {
@ -214,9 +203,6 @@ namespace YooAsset.Editor
} }
public static List<RuleDisplayName> GetPackRuleNames() public static List<RuleDisplayName> GetPackRuleNames()
{ {
if (_setting == null)
LoadSettingData();
List<RuleDisplayName> names = new List<RuleDisplayName>(); List<RuleDisplayName> names = new List<RuleDisplayName>();
foreach (var pair in _cachePackRuleTypes) foreach (var pair in _cachePackRuleTypes)
{ {
@ -229,9 +215,6 @@ namespace YooAsset.Editor
} }
public static List<RuleDisplayName> GetFilterRuleNames() public static List<RuleDisplayName> GetFilterRuleNames()
{ {
if (_setting == null)
LoadSettingData();
List<RuleDisplayName> names = new List<RuleDisplayName>(); List<RuleDisplayName> names = new List<RuleDisplayName>();
foreach (var pair in _cacheFilterRuleTypes) foreach (var pair in _cacheFilterRuleTypes)
{ {