From 2a12608e3b16754fb9d72409c3a9b9914cd1e251 Mon Sep 17 00:00:00 2001
From: Icarus <1375400884@qq.com>
Date: Sat, 21 Dec 2019 20:50:01 +0800
Subject: [PATCH] !TX(Port) remove baseType
---
Scripts/Node.cs | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/Scripts/Node.cs b/Scripts/Node.cs
index 4c94659..b37ead4 100644
--- a/Scripts/Node.cs
+++ b/Scripts/Node.cs
@@ -76,7 +76,7 @@ namespace XNode {
[Obsolete("Use AddDynamicPort instead")]
private NodePort AddInstancePort(Type type, NodePort.IO direction, Node.ConnectionType connectionType = Node.ConnectionType.Multiple, Node.TypeConstraint typeConstraint = TypeConstraint.None, string fieldName = null) {
- return AddDynamicPort(type, direction, connectionType, typeConstraint, null,fieldName);
+ return AddDynamicPort(type, direction, connectionType, typeConstraint, fieldName);
}
[Obsolete("Use RemoveDynamicPort instead")]
@@ -147,21 +147,21 @@ namespace XNode {
/// Convenience function.
///
///
- public NodePort AddDynamicInput(Type type, Node.ConnectionType connectionType = Node.ConnectionType.Multiple, Node.TypeConstraint typeConstraint = TypeConstraint.None,Type baseType = null, string fieldName = null) {
- return AddDynamicPort(type, NodePort.IO.Input, connectionType, typeConstraint,baseType, fieldName);
+ public NodePort AddDynamicInput(Type type, Node.ConnectionType connectionType = Node.ConnectionType.Multiple, Node.TypeConstraint typeConstraint = TypeConstraint.None, string fieldName = null) {
+ return AddDynamicPort(type, NodePort.IO.Input, connectionType, typeConstraint, fieldName);
}
/// Convenience function.
///
///
public NodePort AddDynamicOutput(Type type, Node.ConnectionType connectionType = Node.ConnectionType.Multiple, Node.TypeConstraint typeConstraint = TypeConstraint.None, string fieldName = null) {
- return AddDynamicPort(type, NodePort.IO.Output, connectionType, typeConstraint, null,fieldName);
+ return AddDynamicPort(type, NodePort.IO.Output, connectionType, typeConstraint,fieldName);
}
/// Add a dynamic, serialized port to this node.
///
///
- private NodePort AddDynamicPort(Type type, NodePort.IO direction, Node.ConnectionType connectionType = Node.ConnectionType.Multiple, Node.TypeConstraint typeConstraint = TypeConstraint.None,Type baseType = null, string fieldName = null) {
+ private NodePort AddDynamicPort(Type type, NodePort.IO direction, Node.ConnectionType connectionType = Node.ConnectionType.Multiple, Node.TypeConstraint typeConstraint = TypeConstraint.None, string fieldName = null) {
if (fieldName == null) {
fieldName = "dynamicInput_0";
int i = 0;
@@ -170,7 +170,7 @@ namespace XNode {
Debug.LogWarning("Port '" + fieldName + "' already exists in " + name, this);
return ports[fieldName];
}
- NodePort port = new NodePort(fieldName, type, direction, connectionType, typeConstraint,baseType, this);
+ NodePort port = new NodePort(fieldName, type, direction, connectionType, typeConstraint, this);
ports.Add(fieldName, port);
@@ -400,6 +400,7 @@ namespace XNode {
values.Clear();
foreach (KeyValuePair pair in this) {
+ //Sorting, output port is always after input port
if (pair.Value.direction == NodePort.IO.Input)
{
var firstOutIndex = values.FindIndex(x => x.direction == NodePort.IO.Output);