Version: Unity 6.4 Alpha (6000.4)
LanguageEnglish
  • C#

Node.IPortDefinitionContext.AddOutputPort

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public Unity.GraphToolkit.Editor.IOutputPortBuilder AddOutputPort(string portName);

Parameters

Parameter Description
portName The unique identifier of the output port.

Returns

IOutputPortBuilder An IOutputPortBuilder to further configure the output port.

Description

Adds a new output port with the specified name.

portName is used to identify the port. It must be unique among output ports on the node. This name is used as the ID when calling GetOutputPortByName. If IPortBuilder_1.WithDisplayName is not used, this name is also used as the port's display label. Warning: Changing a port's name will break any existing connections, as the name is used as the port's unique ID. Use the returned builder to configure port properties and then call IPortBuilder_1.Build to create the port.

 var port = context.AddOutputPort("myOutput")
     .WithDisplayName("My Output Port")
     .WithDataType(typeof(float))
     .WithConnectorUI(PortConnectorUI.Arrowhead)
     .Build();

Declaration

public IOutputPortBuilder<T> AddOutputPort(string portName);

Parameters

Parameter Description
portName The unique identifier of the output port.

Returns

IOutputPortBuilder<T> An IOutputPortBuilder_1 to further configure the typed output port.

Description

Adds a new typed output port with the specified name.

portName is used to identify the port. It must be unique among output ports on the node. This name is used as the ID when calling GetOutputPortByName. If IPortBuilder_1.WithDisplayName is not used, this name is also used as the port's display label. Warning: Changing a port's name will break any existing connections, as the name is used as the port's unique ID. Use the returned builder to configure port properties and then call IPortBuilder_1.Build to create the port.

 var port = context.AddOutputPort&lt;bool&gt;("boolOutput")
     .WithDisplayName("Boolean Output")
     .Build();