From eb164225c8a8d091559103dd629697a2e671eb6a Mon Sep 17 00:00:00 2001 From: Thor Brigsted Date: Mon, 15 Apr 2019 00:02:52 +0200 Subject: [PATCH] Fixed #134 - Marked some more methods as virtual --- Scripts/NodeGraph.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Scripts/NodeGraph.cs b/Scripts/NodeGraph.cs index 6b95fc2..38d0364 100644 --- a/Scripts/NodeGraph.cs +++ b/Scripts/NodeGraph.cs @@ -11,7 +11,7 @@ namespace XNode { /// See: [SerializeField] public List nodes = new List(); - /// Add a node to the graph by type + /// Add a node to the graph by type (convenience method - will call the System.Type version) public T AddNode() where T : Node { return AddNode(typeof(T)) as T; } @@ -37,14 +37,14 @@ namespace XNode { /// Safely remove a node and all its connections /// The node to remove - public void RemoveNode(Node node) { + public virtual void RemoveNode(Node node) { node.ClearConnections(); nodes.Remove(node); if (Application.isPlaying) Destroy(node); } /// Remove all nodes and connections from the graph - public void Clear() { + public virtual void Clear() { if (Application.isPlaying) { for (int i = 0; i < nodes.Count; i++) { Destroy(nodes[i]); @@ -54,7 +54,7 @@ namespace XNode { } /// Create a new deep copy of this graph - public XNode.NodeGraph Copy() { + public virtual XNode.NodeGraph Copy() { // Instantiate a new nodegraph instance NodeGraph graph = Instantiate(this); // Instantiate all nodes inside the graph