pull/418/head
何冠峰 2024-12-16 18:05:27 +08:00
parent 58fc76b8d2
commit 19e0c7b01a
4 changed files with 16 additions and 6 deletions

View File

@ -46,7 +46,7 @@ namespace YooAsset.Editor
// 检测分组是否激活
IActiveRule activeRule = AssetBundleCollectorSettingData.GetActiveRuleInstance(ActiveRuleName);
if (activeRule.IsActiveGroup() == false)
if (activeRule.IsActiveGroup(new GroupData(GroupName)) == false)
return;
foreach (var collector in Collectors)
@ -80,7 +80,7 @@ namespace YooAsset.Editor
// 检测分组是否激活
IActiveRule activeRule = AssetBundleCollectorSettingData.GetActiveRuleInstance(ActiveRuleName);
if (activeRule.IsActiveGroup() == false)
if (activeRule.IsActiveGroup(new GroupData(GroupName)) == false)
{
return new List<CollectAssetInfo>();
}

View File

@ -657,7 +657,7 @@ namespace YooAsset.Editor
// 激活状态
IActiveRule activeRule = AssetBundleCollectorSettingData.GetActiveRuleInstance(group.ActiveRuleName);
bool isActive = activeRule.IsActiveGroup();
bool isActive = activeRule.IsActiveGroup(new GroupData(group.GroupName));
textField1.SetEnabled(isActive);
}
private void GroupListView_onSelectionChange(IEnumerable<object> objs)

View File

@ -1,6 +1,16 @@

namespace YooAsset.Editor
{
public struct GroupData
{
public string GroupName;
public GroupData(string groupName)
{
GroupName = groupName;
}
}
/// <summary>
/// 资源分组激活规则接口
/// </summary>
@ -9,6 +19,6 @@ namespace YooAsset.Editor
/// <summary>
/// 是否激活分组
/// </summary>
bool IsActiveGroup();
bool IsActiveGroup(GroupData data);
}
}

View File

@ -4,7 +4,7 @@ namespace YooAsset.Editor
[DisplayName("启用分组")]
public class EnableGroup : IActiveRule
{
public bool IsActiveGroup()
public bool IsActiveGroup(GroupData data)
{
return true;
}
@ -13,7 +13,7 @@ namespace YooAsset.Editor
[DisplayName("禁用分组")]
public class DisableGroup : IActiveRule
{
public bool IsActiveGroup()
public bool IsActiveGroup(GroupData data)
{
return false;
}