Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

ProcessorInstance.IRealtime.OnMessage

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public Response OnMessage(RealtimeMessageContext context, Pipe pipe, Message message);

Parameters

Parameter Description
context A RealtimeMessageContext giving cross-thread data communication via pipe (but no nested processing).
pipe Cross-thread communications pipe.
message The message someone sent to you through RealtimeContext.SendMessage. The contents are sent by reference, so you can modify them and the sender will see the changes.

Returns

Response ProcessorInstance.Response.Handled if this ProcessorInstance acknowledged and processed the message, ProcessorInstance.Response.Unhandled if not or ignored.

Description

Called immediately from RealtimeContext.SendMessage when a message was sent to this ProcessorInstance on the real-time side.

This is the real-time counterpart of ProcessorInstance.IControl<T0>.OnMessage. It runs synchronously on the real-time thread, within the originating RealtimeContext.

This has a default implementation returning ProcessorInstance.Response.Unhandled, so existing IRealtime implementations remain source-compatible; override it to handle real-time messages. Since overriding default methods isn't positively constrained by the compiler, you may find it helpful to implement such interface methods explicitly

Additional resources: RealtimeContext.SendMessage