Register(Guid, UnityAction<MessageEventArgs>)
Registers a listener for a specific message ID, with an Action to be executed whenever that message is received by the Editor. This ID must be the same as for messages sent from EditorConnection.Send().
阅读时间1 分钟最后更新于 24 天前
Definition
- Type: Method
- Namespace: UnityEngine.Networking.PlayerConnection
- Assembly: UnityEngine.CoreModule
public void Register(Guid messageId, UnityAction<MessageEventArgs> callback)
Parameters
The message ID that should cause the Action to be executed when received.
callbackAction that is executed when a message with ID is received by the Editor. The callback includes the data that is sent from the Player, and the Player ID. The Player ID is always 1, because only one Editor can be connected.
messageId