PlayerConnection

class in UnityEngine.Networking.PlayerConnection

/

Inherits from:ScriptableObject


Implements interfaces:IEditorPlayerConnection

Switch to Manual

Description

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.

Static Variables

instanceReturns a singleton instance of a PlayerConnection.

Variables

isConnectedReturns true when the Editor is connected to the Player.

Public Functions

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.

Inherited members

Variables

hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Functions

GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the object.

Static Functions

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.
CreateInstanceCreates an instance of a scriptable object.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.

Messages

AwakeThis function is called when the ScriptableObject script is started.
OnDestroyThis function is called when the scriptable object will be destroyed.
OnDisableThis function is called when the scriptable object goes out of scope.
OnEnableThis function is called when the object is loaded.