pull/186/head^2
hevinci 2023-09-25 16:57:35 +08:00
parent 6fc45a758c
commit 11386a7ec2
3 changed files with 12 additions and 13 deletions

View File

@ -166,7 +166,7 @@ namespace YooAsset.Editor
string[] findAssets = EditorTools.FindAssets(EAssetSearchType.All, collectDirectory); string[] findAssets = EditorTools.FindAssets(EAssetSearchType.All, collectDirectory);
foreach (string assetPath in findAssets) foreach (string assetPath in findAssets)
{ {
if (IsValidateAsset(assetPath, isRawFilePackRule) && IsCollectAsset(assetPath)) if (IsValidateAsset(assetPath, isRawFilePackRule) && IsCollectAsset(group, assetPath))
{ {
if (result.ContainsKey(assetPath) == false) if (result.ContainsKey(assetPath) == false)
{ {
@ -183,7 +183,7 @@ namespace YooAsset.Editor
else else
{ {
string assetPath = CollectPath; string assetPath = CollectPath;
if (IsValidateAsset(assetPath, isRawFilePackRule) && IsCollectAsset(assetPath)) if (IsValidateAsset(assetPath, isRawFilePackRule) && IsCollectAsset(group, assetPath))
{ {
var collectAssetInfo = CreateCollectAssetInfo(command, group, assetPath, isRawFilePackRule); var collectAssetInfo = CreateCollectAssetInfo(command, group, assetPath, isRawFilePackRule);
result.Add(assetPath, collectAssetInfo); result.Add(assetPath, collectAssetInfo);
@ -292,11 +292,11 @@ namespace YooAsset.Editor
return true; return true;
} }
private bool IsCollectAsset(string assetPath) private bool IsCollectAsset(AssetBundleCollectorGroup group, string assetPath)
{ {
// 根据规则设置过滤资源文件 // 根据规则设置过滤资源文件
IFilterRule filterRuleInstance = AssetBundleCollectorSettingData.GetFilterRuleInstance(FilterRuleName); IFilterRule filterRuleInstance = AssetBundleCollectorSettingData.GetFilterRuleInstance(FilterRuleName);
return filterRuleInstance.IsCollectAsset(new FilterRuleData(assetPath)); return filterRuleInstance.IsCollectAsset(new FilterRuleData(assetPath, CollectPath, group.GroupName, UserData));
} }
private string GetAddress(CollectCommand command, AssetBundleCollectorGroup group, string assetPath) private string GetAddress(CollectCommand command, AssetBundleCollectorGroup group, string assetPath)
{ {

View File

@ -4,10 +4,16 @@ namespace YooAsset.Editor
public struct FilterRuleData public struct FilterRuleData
{ {
public string AssetPath; public string AssetPath;
public string CollectPath;
public string GroupName;
public string UserData;
public FilterRuleData(string assetPath) public FilterRuleData(string assetPath, string collectPath, string groupName, string userData)
{ {
AssetPath = assetPath; AssetPath = assetPath;
CollectPath = collectPath;
GroupName = groupName;
UserData = userData;
} }
} }

View File

@ -8,13 +8,6 @@ namespace YooAsset.Editor
public string GroupName; public string GroupName;
public string UserData; public string UserData;
public PackRuleData(string assetPath)
{
AssetPath = assetPath;
CollectPath = string.Empty;
GroupName = string.Empty;
UserData = string.Empty;
}
public PackRuleData(string assetPath, string collectPath, string groupName, string userData) public PackRuleData(string assetPath, string collectPath, string groupName, string userData)
{ {
AssetPath = assetPath; AssetPath = assetPath;