/// <summary> /// Returns a copy of this node. /// <param name = "newOwner">The owner of the new node.</param> /// <returns>The copy of the node.</returns> /// </summary> public virtual ActionNode Copy(INodeOwner newOwner) { // Copy node var copy = newOwner.AddNode(GetType()); // Copy SerializedFields var fields = NodeSerialization.GetSerializedFields(copy.GetType()); for (int i = 0; i < fields.Length; i++) { // Do not copy the instanceID field if (fields[i].Name != "instanceID") { fields[i].SetValue(copy, fields[i].GetValue(this)); } } return(copy); }
/// <summary> /// Returns a copy of this node. /// <param name = "newOwner">The owner of the new node.</param> /// <returns>The copy of the node.</returns> /// </summary> public virtual ActionNode Copy (INodeOwner newOwner) { // Copy node var copy = newOwner.AddNode(GetType()); // Copy SerializedFields var fields = NodeSerialization.GetSerializedFields(copy.GetType()); for (int i = 0; i < fields.Length; i++) { // Do not copy the instanceID field if (fields[i].Name != "instanceID") fields[i].SetValue(copy, fields[i].GetValue(this)); } return copy; }