diff --git a/Scripts/Editor/NodeEditorWindow.cs b/Scripts/Editor/NodeEditorWindow.cs index 72fd4ce..eacfd26 100644 --- a/Scripts/Editor/NodeEditorWindow.cs +++ b/Scripts/Editor/NodeEditorWindow.cs @@ -56,6 +56,13 @@ namespace XNodeEditor { } } + public void Update() { + // Repaint the graph if it is required during update. + if (graph.RepaintOnUpdate) { + Repaint(); + } + } + public Dictionary nodeSizes { get { return _nodeSizes; } } private Dictionary _nodeSizes = new Dictionary(); public XNode.NodeGraph graph; diff --git a/Scripts/NodeGraph.cs b/Scripts/NodeGraph.cs index d6d766c..e94796a 100644 --- a/Scripts/NodeGraph.cs +++ b/Scripts/NodeGraph.cs @@ -78,5 +78,10 @@ namespace XNode { // Remove all nodes prior to graph destruction Clear(); } + + /// Whether the graph requires a repaint during updates. + public virtual bool RepaintOnUpdate { + get { return false; } + } } } \ No newline at end of file