Struct MessageContext
A context provided to a node's Unity.DataFlowGraph.NodeDefinition.OnMessage``1(Unity.DataFlowGraph.MessageContext@,``0@) implementation which is invoked when a node receives a message on one of their MessageInputs.
Inherited Members
Namespace: Unity.DataFlowGraph
Syntax
public struct MessageContext
Properties
ArrayIndex
If the above port ID corresponds to a PortArray<TInputPort>, this is the array index on which the message is being received.
Declaration
public ushort ArrayIndex { get; }
Property Value
Type | Description |
---|---|
UInt16 |
Handle
A handle to the node receiving a message.
Declaration
public NodeHandle Handle { get; }
Property Value
Type | Description |
---|---|
NodeHandle |
Port
The port ID of the MessageInput<TDefinition, TMsg> on which the message is being received.
Declaration
public InputPortID Port { get; }
Property Value
Type | Description |
---|---|
InputPortID |
Methods
EmitMessage<T, TNodeDefinition>(MessageOutput<TNodeDefinition, T>, T)
Emit a message from yourself on a port. Everything connected to it will receive your message.
Declaration
public void EmitMessage<T, TNodeDefinition>(MessageOutput<TNodeDefinition, T> port, in T msg)
where TNodeDefinition : NodeDefinition
Parameters
Type | Name | Description |
---|---|---|
MessageOutput<TNodeDefinition, T> | port | |
T | msg |
Type Parameters
Name | Description |
---|---|
T | |
TNodeDefinition |