Class InPort
In ports can be added to nodes as a means to input data into the node.
Implements
Inherited Members
Namespace: InsaneScatterbrain.ScriptGraph
Syntax
[Serializable]
public class InPort : ScriptGraphPort, ISerializationCallbackReceiver
Properties
ConnectedOut
Gets the out port that this in port is connected to. Null if it's not connected.
Declaration
public OutPort ConnectedOut { get; }
Property Value
Type | Description |
---|---|
OutPort |
IsConnected
Return true if this node is connected to another node, false otherwise.
Declaration
public bool IsConnected { get; }
Property Value
Type | Description |
---|---|
bool |
IsConnectionRequired
Gets/sets whether a connection to this port is required for the node to function properly. False by default.
Declaration
public bool IsConnectionRequired { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
Connect(OutPort)
Connects this in port to the given out port.
Declaration
public void Connect(OutPort outPort)
Parameters
Type | Name | Description |
---|---|---|
OutPort | outPort | The out port. |
Create(string, Type, IScriptNode)
Factory method to create a new in port.
Declaration
public static InPort Create(string name, Type type, IScriptNode owner)
Parameters
Type | Name | Description |
---|---|---|
string | name | The port's name. |
System.Type | type | The port's type. |
IScriptNode | owner | The port's owning node. Usually the node it's part of. |
Returns
Type | Description |
---|---|
InPort | The new in node. |
Disconnect()
Disconnect this in port from the connected out port.
Declaration
public void Disconnect()
Get()
Pulls the data from the connected source and returns it. If the port is unconnected, it returns null.
Declaration
public object Get()
Returns
Type | Description |
---|---|
object | The data, or null if unconnected. |
Get<T>()
Pulls the data from the connected source and returns it. If the port is unconnected, it returns the default value for the type of port.
Declaration
public T Get<T>()
Returns
Type | Description |
---|---|
T | The data, or default value if unconnected. |
Type Parameters
Name | Description |
---|---|
T | The type of the data to return. |