Class ComponentNode
A ComponentNode gives access to component data from a specific
Using Input<TType>(IsComponent<TType>) and Output<TType>(IsComponent<TType>) you can create ports that can be connected to normal nodes, and the data will be readable and writable as usual in the rendering graph. Connect(NodeHandle, OutputPortID, NodeHandle, InputPortID, NodeSetAPI.ConnectionType).
The data will be committed after the returned
ComponentNodes have to be created through CreateComponentNode(Entity), and cannot be instantiated through Create<TDefinition>().
A ComponentNode doesn't do anything itself and cannot be extended - it merely offers a topological dynamic read/write interface through ports to ECS.
Inherited Members
Namespace: Unity.DataFlowGraph
Syntax
public abstract class ComponentNode : NodeDefinition
Remarks
If the target
This API is only available if the hosting NodeSet was created with a companion
When a DataOutput<TDefinition, TType> is linked to a ComponentNode's
PortArray<TPort> have no equivalent on ComponentNodes.
In order to implement in place read-modify-write systems of ECS data, connections with Feedback need to be used in the following fashion.
ComponentNodes appearing downstream in a graph and connected back to parent node(s) via Feedback connections can be understood to feed their "previous" component data to those parent nodes, and, update their component data at the end of any given Update(JobHandle). The "previous" component data will be the most current value from the ECS point of view, so this does not represent a frame delay.
Therefore, if the desire is to model a graph that will read information from an
Methods
Input(ComponentType)
Create an InputPortID matching a particular
Declaration
public static InputPortID Input(ComponentType type)
Parameters
Type | Name | Description |
---|---|---|
ComponentType | type |
Returns
Type | Description |
---|---|
InputPortID |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if the |
Input<TType>(IsBuffer<TType>)
This is a strongly typed version of Input(ComponentType),
specifically for components implementing
Declaration
public static DataInput<ComponentNode, Buffer<TType>> Input<TType>(IsBuffer<TType> _ = default(IsBuffer<TType>))
where TType : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
IsBuffer<TType> | _ |
Returns
Type | Description |
---|---|
DataInput<ComponentNode, Buffer<TType>> |
Type Parameters
Name | Description |
---|---|
TType |
Input<TType>(IsComponent<TType>)
This is a strongly typed version of Input(ComponentType), with otherwise identical semantics.
Declaration
public static DataInput<ComponentNode, TType> Input<TType>(IsComponent<TType> _ = default(IsComponent<TType>))
where TType : struct, IComponentData
Parameters
Type | Name | Description |
---|---|---|
IsComponent<TType> | _ |
Returns
Type | Description |
---|---|
DataInput<ComponentNode, TType> |
Type Parameters
Name | Description |
---|---|
TType |
Output(ComponentType)
Create an OutputPortID matching a particular
Declaration
public static OutputPortID Output(ComponentType type)
Parameters
Type | Name | Description |
---|---|---|
ComponentType | type |
Returns
Type | Description |
---|---|
OutputPortID |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if the |
Output<TType>(IsBuffer<TType>)
This is a strongly typed version of Output(ComponentType),
specifically for components implementing
Declaration
public static DataOutput<ComponentNode, Buffer<TType>> Output<TType>(IsBuffer<TType> _ = default(IsBuffer<TType>))
where TType : struct, IBufferElementData
Parameters
Type | Name | Description |
---|---|---|
IsBuffer<TType> | _ |
Returns
Type | Description |
---|---|
DataOutput<ComponentNode, Buffer<TType>> |
Type Parameters
Name | Description |
---|---|
TType |
Output<TType>(IsComponent<TType>)
This is a strongly typed version of Output(ComponentType), with otherwise identical semantics.
Declaration
public static DataOutput<ComponentNode, TType> Output<TType>(IsComponent<TType> _ = default(IsComponent<TType>))
where TType : struct, IComponentData
Parameters
Type | Name | Description |
---|---|---|
IsComponent<TType> | _ |
Returns
Type | Description |
---|---|
DataOutput<ComponentNode, TType> |
Type Parameters
Name | Description |
---|---|
TType |