예제 #1
0
    public override void TryGetOutputValue <T>(NodePort outputPort, NodePort inputPort, ref T value)
    {
        if (inputPorts.Count == 0)
        {
            return;
        }

        var inputPortEdges = inputPorts[0].GetEdges();

        if (outputPort.portData.identifier != packIdentifier && (unpackOutput || inputPortEdges.Count == 1))
        {
            if (output.values == null)
            {
                return;
            }

            int inputPortIndexInOutputPortEdge = outputPort.GetEdges().FindIndex(edge => edge.inputPort == inputPort);
            if (output.values[inputPortIndexInOutputPortEdge] is T finalValue)
            {
                value = finalValue;
            }
        }
        else
        {
            if (output is T finalValue)
            {
                value = finalValue;
            }
        }
    }
예제 #2
0
    public override void TryGetOutputValue <T>(NodePort outputPort, NodePort inputPort, ref T value)
    {
        int inputPortIndexInOutputPortEdge = outputPort.GetEdges().FindIndex(edge => edge.inputPort == inputPort);

        if (outputRadians[inputPortIndexInOutputPortEdge] is T finalValue)
        {
            value = finalValue;
        }
    }
    public override void TryGetOutputValue <T>(NodePort outputPort, NodePort inputPort, ref T value)
    {
        //出端口所有连线对应端口中,目标入端口所对应的index
        int inputPortIndexInOutputPortEdge = outputPort.GetEdges().FindIndex(edge => edge.inputPort == inputPort);

        if (outputs[inputPortIndexInOutputPortEdge] is T finalValue)
        {
            value = finalValue;
        }
    }