-
-
Notifications
You must be signed in to change notification settings - Fork 597
Node
Thor Brigsted edited this page Nov 8, 2018
·
12 revisions
Base class for all nodes
public abstract class XNode.Node
: ScriptableObject
Fields
Type | Name | Summary |
---|---|---|
NodeGraph |
graph | Parent NodeGraph |
Vector2 |
position | Position on the NodeGraph |
Properties
Type | Name | Summary |
---|---|---|
IEnumerable<NodePort> |
Inputs | Iterate over all inputs on this node. |
IEnumerable<NodePort> |
InstanceInputs | Iterate over all instance inputs on this node. |
IEnumerable<NodePort> |
InstanceOutputs | Iterate over all instance outputs on this node. |
IEnumerable<NodePort> |
InstancePorts | Iterate over all instane ports on this node. |
IEnumerable<NodePort> |
Outputs | Iterate over all outputs on this node. |
IEnumerable<NodePort> |
Ports | Iterate over all ports on this node. |
Methods
Type | Name | Summary |
---|---|---|
NodePort |
AddInstanceInput(Type type, String fieldName = null) |
Add a dynamic, serialized port to this node |
NodePort |
AddInstanceOutput(Type type, String fieldName = null) |
Add a dynamic, serialized port to this node |
void |
ClearConnections() | Disconnect everything from this node |
void |
ClearInstancePorts() | Removes all instance ports from the node |
NodePort |
GetInputPort(String fieldName) |
Returns input port which matches fieldName |
T |
GetInputValue(String fieldName, T fallback = null) |
|
T[] |
GetInputValues(String fieldName, T[] fallback) |
|
NodePort |
GetOutputPort(String fieldName) |
Returns output port which matches fieldName |
NodePort |
GetPort(String fieldName) |
Returns port which matches fieldName |
Object |
GetValue(NodePort port) |
Returns a value based on requested port output. Should be overridden before used. |
Boolean |
HasPort(String fieldName) |
|
void |
Init() | Initialize node. Called on creation. |
void |
OnCreateConnection(NodePort from, NodePort to) |
Called after a connection between two ports is created |
void |
OnRemoveConnection(NodePort port) |
Called after a connection is removed from this port |
void |
RemoveInstancePort(String fieldName) |
Remove an instance port from the node |
void |
RemoveInstancePort(NodePort port) |
Remove an instance port from the node |
void |
VerifyConnections() | Checks all connections for invalid references, and removes them. |