PlayerConnection
Used for handling the network connection from the Player to the Editor.
읽는 시간 4분최근 업데이트: 한 달 전
Definition
- Type: Class
- Namespace: UnityEngine.Networking.PlayerConnection
- Assembly: UnityEngine.CoreModule
- Inherits from: ScriptableObject
public class PlayerConnection : ScriptableObject
Remarks
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.
Properties
Property | Description |
|---|---|
| isConnected | Returns true when the Editor is connected to the Player. |
Static Properties
Property | Description |
|---|---|
| instance | Returns a singleton instance of a PlayerConnection. |
Methods
Method | Description |
|---|---|
| BlockUntilRecvMsg | Blocks the calling thread until either a message with the specified |
| DisconnectAll | This disconnects all of the active connections. |
| Register | 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(). |
| RegisterConnection | Registers a callback that is invoked when the Editor connects to the Player. |
| RegisterDisconnection | Registers a callback to be called when Editor disconnects. |
| Send | Sends data to the Editor. |
| TrySend | Attempt to sends data to the Editor. |
| Unregister | Deregisters a message listener. |
| UnregisterConnection | Unregisters the connection callback. |
| UnregisterDisconnection | Unregisters the disconnection callback. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |