AddOutputPort
Adds a new output port with the specified name.
Read time 2 minutesLast updated 6 days ago
Definition
- Type: Method
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
AddOutputPort(string)
Adds a new output port with the specified name.
IOutputPortBuilder AddOutputPort(string portName)
Parameters
The unique identifier of the output port.
Returns
Type | Description |
|---|---|
| IOutputPortBuilder | An IOutputPortBuilder to further configure the output port. |
Remarks
portNameWarning: Changing a port's name breaks any existing connections, because the name is used as the port's unique ID.
Use the returned builder to configure port properties and then call IPortBuilder<T>.Build() to create the port.
Examples
var port = context.AddOutputPort("myOutput") .WithDisplayName("My Output Port") .WithDataType(typeof(float)) .WithConnectorUI(PortConnectorUI.Arrowhead) .Build();
AddOutputPort<T>(string)
Adds a new typed output port with the specified name.
IOutputPortBuilder<T> AddOutputPort<T>(string portName)
Parameters
The unique identifier of the output port.
Returns
Type | Description |
|---|---|
| IOutputPortBuilder<T> | An IOutputPortBuilder<TData> to further configure the typed output port. |
Remarks
portNameWarning: Changing a port's name breaks any existing connections, because the name is used as the port's unique ID.
Use the returned builder to configure port properties and then call IPortBuilder<T>.Build() to create the port.
Examples
var port = context.AddOutputPort<bool>("boolOutput") .WithDisplayName("Boolean Output") .Build();