Skip to content

Node.AddInstancePort

Thor Brigsted edited this page Mar 5, 2019 · 4 revisions

Add a dynamic, serialized output port to this node

public NodePort AddInstancePort(Type type, NodePort.IO direction, string fieldName = null);
Parameters Summary
type NodePort value type.
direction Whether this is an input or output port.
fieldName Unique identifier used to find this NodePort. Automatically assigns a unique name if null.
using UnityEngine;
using XNode;

public class ExampleNode : Node{

    [ContextMenu("Add instance output")]
    void AddPort() {
        NodePort port = AddInstancePort(typeof(float), NodePort.IO.Input);
        Debug.Log("Added new output port with name " + port.fieldName);
    }
}

See also: AddInstanceInput, AddInstanceOutput, RemoveInstancePort

Clone this wiki locally