private static Dictionary<NodeData, Dictionary<string, List<Asset>>> CollectNodeGroupAndAssets(
SaveData data,
Dictionary<ConnectionData, Dictionary<string, List<Asset>>> result
)
{
var nodeDatas = new Dictionary<NodeData, Dictionary<string, List<Asset>>>();
foreach (var c in result.Keys) {
var targetNode = data.Nodes.Find(node => node.Id == c.FromNodeId);
var groupDict = result[c];
if (!nodeDatas.ContainsKey(targetNode)) {
nodeDatas[targetNode] = new Dictionary<string, List<Asset>>();
}
foreach (var groupKey in groupDict.Keys) {
if (!nodeDatas[targetNode].ContainsKey(groupKey)) {
nodeDatas[targetNode][groupKey] = new List<Asset>();
}
nodeDatas[targetNode][groupKey].AddRange(groupDict[groupKey]);
}
}
return nodeDatas;
}