Skip to content

Commit ef3db60

Browse files
committed
Changed the HandleDeleteSelection method in StateGraphView to remove all selected items but the data is not removed from the StateMachineModel so this still needs some work
1 parent a8c2c1b commit ef3db60

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

Editor/StateGraph/VisualElements/StateGraphView.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,15 @@ private void HandlePasteSelected()
278278
private void HandleDeleteSelection()
279279
{
280280
if (GuardUtils.GuardAgainstRuntimeOperation()) return;
281-
282-
var selectedNodeModels = selection
283-
.OfType<NodeView>()
284-
.ToList();
285-
286-
DeleteNodes(selectedNodeModels);
281+
282+
for (var index = this.selection.Count - 1; index >= 0; index--)
283+
{
284+
var item = this.selection[index];
285+
if (item is VisualElement element)
286+
{
287+
element.RemoveFromHierarchy();
288+
}
289+
}
287290
}
288291

289292
private void HandleDeleteStateNode(NodeView nodeView)

0 commit comments

Comments
 (0)