1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 09:16:01 +08:00

Fixed #134 - Marked some more methods as virtual

This commit is contained in:
Thor Brigsted 2019-04-15 00:02:52 +02:00
parent 4cf7113740
commit eb164225c8

View File

@ -11,7 +11,7 @@ namespace XNode {
/// See: <see cref="AddNode{T}"/> </summary>
[SerializeField] public List<Node> nodes = new List<Node>();
/// <summary> Add a node to the graph by type </summary>
/// <summary> Add a node to the graph by type (convenience method - will call the System.Type version) </summary>
public T AddNode<T>() where T : Node {
return AddNode(typeof(T)) as T;
}
@ -37,14 +37,14 @@ namespace XNode {
/// <summary> Safely remove a node and all its connections </summary>
/// <param name="node"> The node to remove </param>
public void RemoveNode(Node node) {
public virtual void RemoveNode(Node node) {
node.ClearConnections();
nodes.Remove(node);
if (Application.isPlaying) Destroy(node);
}
/// <summary> Remove all nodes and connections from the graph </summary>
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 {
}
/// <summary> Create a new deep copy of this graph </summary>
public XNode.NodeGraph Copy() {
public virtual XNode.NodeGraph Copy() {
// Instantiate a new nodegraph instance
NodeGraph graph = Instantiate(this);
// Instantiate all nodes inside the graph