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.
Syntax
public struct MessageContext
Properties
ArrayIndex
If the above port ID corresponds to a PortArray<TPort>, this is the array index on which the message
is being received.
Declaration
public ushort ArrayIndex { get; }
Property Value
Handle
A handle to the node receiving a message.
Declaration
public NodeHandle Handle { get; }
Property Value
Port
Declaration
public InputPortID Port { get; }
Property Value
Set
Declaration
public NodeSetAPI Set { get; }
Property Value
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 |
|
EmitMessage<T, TNodeDefinition>(PortArray<MessageOutput<TNodeDefinition, T>>, Int32, T)
Emit a message from yourself on a port array. Everything connected to it will receive your message.
Declaration
public void EmitMessage<T, TNodeDefinition>(PortArray<MessageOutput<TNodeDefinition, T>> port, int arrayIndex, in T msg)
where TNodeDefinition : NodeDefinition
Parameters
Type Parameters
Name |
Description |
T |
|
TNodeDefinition |
|
Exceptions
RegisterForUpdate()
Declaration
public void RegisterForUpdate()
Exceptions
RemoveFromUpdate()
Declaration
public void RemoveFromUpdate()
Exceptions
SetKernelBufferSize<TGraphKernel>(TGraphKernel)
Declaration
[Obsolete("Renamed to UpdateKernelBuffers (RemovedAfter 2021-01-19)")]
public void SetKernelBufferSize<TGraphKernel>(in TGraphKernel requestedSize)
where TGraphKernel : struct, IGraphKernel
Parameters
Type |
Name |
Description |
TGraphKernel |
requestedSize |
|
Type Parameters
Name |
Description |
TGraphKernel |
|
UpdateKernelBuffers<TGraphKernel>(TGraphKernel)
Declaration
public void UpdateKernelBuffers<TGraphKernel>(in TGraphKernel kernel)
where TGraphKernel : struct, IGraphKernel
Parameters
Type |
Name |
Description |
TGraphKernel |
kernel |
|
Type Parameters
Name |
Description |
TGraphKernel |
|
UpdateKernelData<TKernelData>(TKernelData)
Updates the associated TKernelData
asynchronously,
to be available in a IGraphKernel in the next render.
Declaration
public void UpdateKernelData<TKernelData>(in TKernelData data)
where TKernelData : struct, IKernelData
Parameters
Type |
Name |
Description |
TKernelData |
data |
|
Type Parameters
Name |
Description |
TKernelData |
|
UploadRequest<T>(NativeArray<T>, BufferUploadMethod)
Declaration
public Buffer<T> UploadRequest<T>(NativeArray<T> inputMemory, BufferUploadMethod method = BufferUploadMethod.Copy)
where T : struct
Parameters
Returns
Type Parameters
Operators
Implicit(MessageContext to CommonContext)
Conversion operator for common API shared with other contexts.
Declaration
public static implicit operator CommonContext(in MessageContext ctx)
Parameters
Returns