private List<InfoflowModuleConnection> FilterConnectionsByFragments(
List<InfoflowModuleConnection> connections,
HashSet<Transform> fragments)
{
List<InfoflowModuleConnection> filteredConnections = new List<InfoflowModuleConnection>();
if (connections == null || fragments == null || fragments.Count == 0)
return filteredConnections;
foreach (InfoflowModuleConnection connection in connections)
{
if (connection == null)
continue;
if (fragments.Contains(connection.SourceModule) || fragments.Contains(connection.TargetModule))
{
filteredConnections.Add(connection);
}
}
return filteredConnections;
}