mirror of
https://github.com/Siccity/xNode.git
synced 2026-03-26 22:49:02 +08:00
Uncommitted stuff
This commit is contained in:
parent
72a80deb27
commit
77b4c034bf
@ -385,20 +385,26 @@ namespace XNodeEditor {
|
||||
list.onRemoveCallback =
|
||||
(ReorderableList rl) => {
|
||||
int index = rl.index;
|
||||
// Clear the removed ports connections
|
||||
instancePorts[index].ClearConnections();
|
||||
// Move following connections one step up to replace the missing connection
|
||||
for (int k = index + 1; k < instancePorts.Count(); k++) {
|
||||
for (int j = 0; j < instancePorts[k].ConnectionCount; j++) {
|
||||
XNode.NodePort other = instancePorts[k].GetConnection(j);
|
||||
instancePorts[k].Disconnect(other);
|
||||
instancePorts[k - 1].Connect(other);
|
||||
|
||||
if (instancePorts.Count > index) {
|
||||
// Clear the removed ports connections
|
||||
instancePorts[index].ClearConnections();
|
||||
// Move following connections one step up to replace the missing connection
|
||||
for (int k = index + 1; k < instancePorts.Count(); k++) {
|
||||
for (int j = 0; j < instancePorts[k].ConnectionCount; j++) {
|
||||
XNode.NodePort other = instancePorts[k].GetConnection(j);
|
||||
instancePorts[k].Disconnect(other);
|
||||
instancePorts[k - 1].Connect(other);
|
||||
}
|
||||
}
|
||||
// Remove the last instance port, to avoid messing up the indexing
|
||||
node.RemoveInstancePort(instancePorts[instancePorts.Count() - 1].fieldName);
|
||||
serializedObject.Update();
|
||||
EditorUtility.SetDirty(node);
|
||||
} else {
|
||||
Debug.LogWarning("InstancePorts[" + index + "] out of range. Length was " + instancePorts.Count + ". Skipping.");
|
||||
}
|
||||
// Remove the last instance port, to avoid messing up the indexing
|
||||
node.RemoveInstancePort(instancePorts[instancePorts.Count() - 1].fieldName);
|
||||
serializedObject.Update();
|
||||
EditorUtility.SetDirty(node);
|
||||
|
||||
if (hasArrayData) {
|
||||
arrayData.DeleteArrayElementAtIndex(index);
|
||||
arraySize--;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user