Skip to content

Node.GetValue

Thor Brigsted edited this page May 23, 2018 · 2 revisions

Returns a value based on requested port output. Should be overridden in all derived nodes with outputs.

public override object GetValue(NodePort port);
Parameters Summary
port The requested port

When a user calls GetInputValue, the value is returned from the connected node's GetValue method. Override this method to specify what is returned.

public class MyNode: Node {
    public float value;
    [Output] public float outA;
    [Output] public float outB;

    public override object GetValue(NodePort port) {
        // Check which output is being requested. 
        switch(port.fieldName) {
            case "outA": return value; // return value
            case "outB": return -value; // return negative value
        }
    }
}

See also: GetInputValue GetInputValues

Clone this wiki locally