Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


IPort

Interface for a node port.
Read time 1 minuteLast updated 6 days ago

Definition

public interface IPort

Remarks

Use this interface to access port metadata and connectivity.
A port represents an input or output slot on a node and users can connect ports to other ports to form graph relationships. Each port has a unique name within its node context, a data type, and a direction. Users can only connect a port to another port if they are compatible as follows: The ports must have opposite PortDirection (i.e., one input and one output).Either both ports must have the same data type or the output port must be a derived data type and the input port, a base data type. Of course the derived data type must be derived from the same base type.
To retrieve the node that owns the port, use
INodeExtensions.GetNode
.

Properties

Property

Description

DataTypeThe data type associated with the port.
DirectionThe direction of the port.
DisplayNameThe label displayed in the UI for the port.
FirstConnectedPortThe first port connected to this port, if any.
IsConnectedIndicates whether the port is currently connected to any other port.
NameThe unique identifier name of the port.
TooltipThe text displayed when hovering over the port's label.

Methods

Method

Description

GetConnectedPortsRetrieves all ports connected to this port.
TryGetValueRetrieves the current value assigned to the port’s UI field.
TrySetValueSets a new value to the port's UI field.