mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-21 01:36:03 +08:00
Fixed bug that would cause nodes without static ports to not properly remove old static ports
This commit is contained in:
parent
455bb723d2
commit
4f65fcefc6
@ -9,7 +9,7 @@ namespace BasicNodes {
|
|||||||
base.OnBodyGUI();
|
base.OnBodyGUI();
|
||||||
NodeEditorGUILayout.PortField(target.GetInputPort("input"));
|
NodeEditorGUILayout.PortField(target.GetInputPort("input"));
|
||||||
object obj = target.GetValue(null);
|
object obj = target.GetValue(null);
|
||||||
if (obj != null) EditorGUILayout.LabelField(target.GetValue(null).ToString());
|
if (obj != null) EditorGUILayout.LabelField(obj.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -16,10 +16,11 @@ namespace XNode {
|
|||||||
Dictionary<string, NodePort> staticPorts = new Dictionary<string, NodePort>();
|
Dictionary<string, NodePort> staticPorts = new Dictionary<string, NodePort>();
|
||||||
System.Type nodeType = node.GetType();
|
System.Type nodeType = node.GetType();
|
||||||
|
|
||||||
if (!portDataCache.ContainsKey(nodeType)) return;
|
if (portDataCache.ContainsKey(nodeType)) {
|
||||||
for (int i = 0; i < portDataCache[nodeType].Count; i++) {
|
for (int i = 0; i < portDataCache[nodeType].Count; i++) {
|
||||||
staticPorts.Add(portDataCache[nodeType][i].fieldName, portDataCache[nodeType][i]);
|
staticPorts.Add(portDataCache[nodeType][i].fieldName, portDataCache[nodeType][i]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Cleanup port dict - Remove nonexisting static ports - update static port types
|
// Cleanup port dict - Remove nonexisting static ports - update static port types
|
||||||
foreach (NodePort port in ports.Values.ToList()) {
|
foreach (NodePort port in ports.Values.ToList()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user