- S4-03 | 先固化 Tag 系统设计与首发范围
- S4-04 | 实现组件实例 Tag 的统一生成入口 - S4-05 | 实现组塔后的 Tag 汇总与展示入口
This commit is contained in:
+5
-26
@@ -107,8 +107,12 @@ namespace GeometryTD.CustomComponent
|
||||
AttackSpeed = BuildLevelFloatArray(baseComp.AttackSpeed, baseComp.Rarity, baseConfig.AttackSpeedPerLevel),
|
||||
AttackMethodType = muzzleComp.AttackMethodType,
|
||||
AttackPropertyType = baseComp.AttackPropertyType,
|
||||
Tags = MergeTags(muzzleComp.Tags, bearingComp.Tags, baseComp.Tags)
|
||||
TagRuntimes = TowerTagAggregationService.AggregateTowerTags(
|
||||
muzzleComp.Tags,
|
||||
bearingComp.Tags,
|
||||
baseComp.Tags)
|
||||
};
|
||||
stats.Tags = TowerTagAggregationService.FlattenUniqueTags(stats.TagRuntimes);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -159,31 +163,6 @@ namespace GeometryTD.CustomComponent
|
||||
return rarityBaseArray[rarityIndex];
|
||||
}
|
||||
|
||||
private static TagType[] MergeTags(params TagType[][] sources)
|
||||
{
|
||||
HashSet<TagType> uniqueTags = new HashSet<TagType>();
|
||||
if (sources != null)
|
||||
{
|
||||
for (int i = 0; i < sources.Length; i++)
|
||||
{
|
||||
TagType[] tags = sources[i];
|
||||
if (tags == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int j = 0; j < tags.Length; j++)
|
||||
{
|
||||
uniqueTags.Add(tags[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TagType[] mergedTags = new TagType[uniqueTags.Count];
|
||||
uniqueTags.CopyTo(mergedTags);
|
||||
return mergedTags;
|
||||
}
|
||||
|
||||
private IDataTable<DRMuzzleComp> EnsureMuzzleTable()
|
||||
{
|
||||
_drMuzzleComp ??= GameEntry.DataTable.GetDataTable<DRMuzzleComp>();
|
||||
|
||||
Reference in New Issue
Block a user