mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
!W(Node) output动态端口永远在最后
This commit is contained in:
parent
17eb6cdae1
commit
ec7133d862
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace XNode {
|
namespace XNode {
|
||||||
@ -168,7 +169,9 @@ namespace XNode {
|
|||||||
return ports[fieldName];
|
return ports[fieldName];
|
||||||
}
|
}
|
||||||
NodePort port = new NodePort(fieldName, type, direction, connectionType, typeConstraint,baseType, this);
|
NodePort port = new NodePort(fieldName, type, direction, connectionType, typeConstraint,baseType, this);
|
||||||
|
|
||||||
ports.Add(fieldName, port);
|
ports.Add(fieldName, port);
|
||||||
|
|
||||||
return port;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,6 +397,19 @@ namespace XNode {
|
|||||||
keys.Clear();
|
keys.Clear();
|
||||||
values.Clear();
|
values.Clear();
|
||||||
foreach (KeyValuePair<string, NodePort> pair in this) {
|
foreach (KeyValuePair<string, NodePort> pair in this) {
|
||||||
|
|
||||||
|
if (pair.Value.direction == NodePort.IO.Input)
|
||||||
|
{
|
||||||
|
var firstOutIndex = values.FindIndex(x => x.direction == NodePort.IO.Output);
|
||||||
|
|
||||||
|
if (firstOutIndex > -1)
|
||||||
|
{
|
||||||
|
keys.Insert(firstOutIndex,pair.Key);
|
||||||
|
values.Insert(firstOutIndex,pair.Value);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
keys.Add(pair.Key);
|
keys.Add(pair.Key);
|
||||||
values.Add(pair.Value);
|
values.Add(pair.Value);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user