PlayerConnection

class in UnityEngine.Networking.PlayerConnection


Implementa interfaces:IEditorPlayerConnection

Cambiar al Manual

Descripción

Used for handling the network connection from the Player to the Editor.

Sets up events for connecting to and sending data to the Editor.

This can only be used in a class that inherits from MonoBehaviour, Object or ScriptableObject.

Variables Estáticas

instanceReturns a singleton instance of a PlayerConnection.

Variables

isConnectedReturns true when the Editor is connected to the Player.

Funciones Públicas

BlockUntilRecvMsgBlocks the calling thread until either a message with the specified messageId is received or the specified time-out elapses.
DisconnectAllThis disconnects all of the active connections.
RegisterRegisters 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().
RegisterConnectionRegisters a callback that is invoked when the Editor connects to the Player.
RegisterDisconnectionRegisters a callback to be called when Editor disconnects.
SendSends data to the Editor.
TrySendAttempt to sends data to the Editor.
UnregisterDeregisters a message listener.
UnregisterConnectionUnregisters the connection callback.
UnregisterDisconnectionUnregisters the disconnection callback.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961