AddInputPort
Adds a new input port.
Read time 2 minutesLast updated 6 days ago
Definition
- Type: Method
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
AddInputPort(string)
Adds a new input port.
IInputPortBuilder AddInputPort(string portName)
Parameters
The unique identifier of the input port.
Returns
Type | Description |
|---|---|
| IInputPortBuilder | An IInputPortBuilder to further configure the input 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.AddInputPort("myInput") .WithDisplayName("My Input Port") .WithDataType<int>() .WithConnectorUI(PortConnectorUI.Circle) .Build();
AddInputPort<T>(string)
Adds a new typed input port with the specified name.
IInputPortBuilder<T> AddInputPort<T>(string portName)
Parameters
The unique identifier of the input port.
Returns
Type | Description |
|---|---|
| IInputPortBuilder<T> | An IInputPortBuilder<TData> to further configure the typed input 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.AddInputPort<string>("stringInput") .WithDisplayName("String Input") .WithDefaultValue("default text") .Build();