File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Assets/com.alelievr.NodeGraphProcessor/Editor/Views Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -604,6 +604,14 @@ void ReloadView()
604
604
// so the one that are not serialized need to be synchronized)
605
605
graph . Deserialize ( ) ;
606
606
607
+ // Get selected nodes
608
+ var selectedNodeGUIDs = new List < string > ( ) ;
609
+ foreach ( var e in selection )
610
+ {
611
+ if ( e is BaseNodeView v && this . Contains ( v ) )
612
+ selectedNodeGUIDs . Add ( v . nodeTarget . GUID ) ;
613
+ }
614
+
607
615
// Remove everything
608
616
RemoveNodeViews ( ) ;
609
617
RemoveEdges ( ) ;
@@ -623,6 +631,15 @@ void ReloadView()
623
631
Reload ( ) ;
624
632
625
633
UpdateComputeOrder ( ) ;
634
+
635
+ // Restore selection after re-creating all views
636
+ // selection = nodeViews.Where(v => selectedNodeGUIDs.Contains(v.nodeTarget.GUID)).Select(v => v as ISelectable).ToList();
637
+ foreach ( var guid in selectedNodeGUIDs )
638
+ {
639
+ AddToSelection ( nodeViews . FirstOrDefault ( n => n . nodeTarget . GUID == guid ) ) ;
640
+ }
641
+
642
+ UpdateNodeInspectorSelection ( ) ;
626
643
}
627
644
628
645
public void Initialize ( BaseGraph graph )
You can’t perform that action at this time.
0 commit comments