void OnGraphChanges(GraphChanges changes) { schedule.Execute(() => { ForceUpdatePorts(); UpdateSize(); MarkDirtyRepaint(); }).ExecuteLater(1); }
void ProcessGraphWhenChanged(GraphChanges changes) { if (delayQueued) { return; } if (changes.addedEdge != null || changes.removedEdge != null || changes.addedNode != null || changes.removedNode != null || changes.nodeChanged != null) { EditorApplication.update += DelayedProcess; void DelayedProcess() { ProcessGraph(changes.nodeChanged ?? changes.addedNode); delayQueued = false; EditorApplication.update -= DelayedProcess; } delayQueued = true; } }
private void OnOnGraphChanges(GraphChanges changes) { switch (changes) { case GraphChanges _ when changes.addedNode != null: UniNodeAction(changes.addedNode, OnNodeAdded); break; case GraphChanges _ when changes.removedNode != null: UniNodeAction(changes.removedNode, OnNodeRemoved); break; case GraphChanges _ when changes.removedEdge != null: UniPortAction(changes.removedEdge, OnEdgeRemoved); break; case GraphChanges _ when changes.addedEdge != null: UniPortAction(changes.addedEdge, OnEdgeAdded); break; case GraphChanges _ when changes.addedGroups != null: break; case GraphChanges _ when changes.removedGroups != null: break; case GraphChanges _ when changes.removedStackNode != null: break; case GraphChanges _ when changes.addedStackNode != null: break; case GraphChanges _ when changes.nodeChanged != null: UniNodeAction(changes.nodeChanged, OnNodeChanged); break; } }
private void OnOnGraphChanges(GraphChanges changes) { switch (changes) { case { addedNode: { } } :