Пример #1
0
        public void OnEdgeDisonnected(SerializableEdge edge)
        {
            if (edge == null)
            {
                return;
            }

            bool input = edge.inputNode == this;
            NodePortContainer portCollection = (input) ? (NodePortContainer)inputPorts : outputPorts;

            portCollection.Remove(edge);
        }
Пример #2
0
        public void OnEdgeDisconnected(SerializableEdge edge)
        {
            if (edge == null)
            {
                return;
            }

            bool input = edge.inputNode == this;
            NodePortContainer portCollection = (input) ? (NodePortContainer)inputPorts : outputPorts;

            portCollection.Remove(edge);

            UpdatePortsForField((input) ? edge.inputFieldName : edge.outputFieldName);

            onAfterEdgeDisconnected?.Invoke(edge);
        }
Пример #3
0
        public void OnEdgeDisconnected(SerializableEdge edge)
        {
            if (edge == null)
            {
                return;
            }

            bool input = edge.inputNode == this;
            NodePortContainer portCollection = (input) ? (NodePortContainer)inputPorts : outputPorts;

            portCollection.Remove(edge);

            // Reset default values of input port:
            bool haveConnectedEdges = edge.inputNode.inputPorts.Where(p => p.fieldName == edge.inputFieldName).Any(p => p.GetEdges().Count != 0);

            if (edge.inputNode == this && !haveConnectedEdges && CanResetPort(edge.inputPort))
            {
                edge.inputPort?.ResetToDefault();
            }

            UpdateAllPorts();

            onAfterEdgeDisconnected?.Invoke(edge);
        }