Skip to content

Commit aada99c

Browse files
committed
Fixed a bug with template graph visualization
1 parent 8eb9edf commit aada99c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Editor/Editors/Components/TemplateGraph.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void AddTemplateNode(string moduleId, ModuleTemplate template)
9696
{
9797

9898
var tempList = new List<TemplateNode>();
99-
foreach ((TemplateNode parent, string key) in Nodes.Select(item => (item, template.Keywords.FirstOrDefault(y => IsKeywordValid(moduleId, item, y)))).Where(x => !string.IsNullOrEmpty(x.Item2)))
99+
foreach ((TemplateNode parent, string key) in Nodes.SelectMany(item => template.Keywords.Where(y => IsKeywordValid(moduleId, item, y)).Select(y => (item, y))).Where(x => !string.IsNullOrEmpty(x.Item2)))
100100
{
101101
var node = new TemplateNode(moduleId, template, key);
102102
AddElement(node);
@@ -109,7 +109,7 @@ public void AddTemplateNode(string moduleId, ModuleTemplate template)
109109
public void AddTemplateNode(string moduleId, TemplateAsset template, string[] keywords)
110110
{
111111
var tempList = new List<TemplateNode>();
112-
foreach ((TemplateNode parent, string key) in Nodes.Select(item => (item, keywords.FirstOrDefault(y => IsKeywordValid(moduleId, item, y)))).Where(x => !string.IsNullOrEmpty(x.Item2)))
112+
foreach ((TemplateNode parent, string key) in Nodes.SelectMany(item => keywords.Where(y => IsKeywordValid(moduleId, item, y)).Select(y => (item, y))).Where(x => !string.IsNullOrEmpty(x.Item2)))
113113
{
114114
var node = new TemplateNode(moduleId, template, key);
115115
AddElement(node);

0 commit comments

Comments
 (0)