IPort
Interface for a node port.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Interface
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
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.GetNodeProperties
Property | Description |
|---|---|
| DataType | The data type associated with the port. |
| Direction | The direction of the port. |
| DisplayName | The label displayed in the UI for the port. |
| FirstConnectedPort | The first port connected to this port, if any. |
| IsConnected | Indicates whether the port is currently connected to any other port. |
| Name | The unique identifier name of the port. |
| Tooltip | The text displayed when hovering over the port's label. |
Methods
Method | Description |
|---|---|
| GetConnectedPorts | Retrieves all ports connected to this port. |
| TryGetValue | Retrieves the current value assigned to the port’s UI field. |
| TrySetValue | Sets a new value to the port's UI field. |