C# Class UnityEngine.Networking.ClientScene

A client manager which contains static client information and functions.

Datei anzeigen Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Public Methods

Method Description
AddPlayer ( NetworkConnection readyConn, short playerControllerId ) : bool

This adds a player GameObject for this client. This causes an AddPlayer message to be sent to the server, and NetworkManager.OnServerAddPlayer is called. If an extra message was passed to AddPlayer, then OnServerAddPlayer will be called with a NetworkReader that contains the contents of the message.

AddPlayer ( NetworkConnection readyConn, short playerControllerId, MessageBase extraMessage ) : bool

This adds a player GameObject for this client. This causes an AddPlayer message to be sent to the server, and NetworkManager.OnServerAddPlayer is called. If an extra message was passed to AddPlayer, then OnServerAddPlayer will be called with a NetworkReader that contains the contents of the message.

AddPlayer ( short playerControllerId ) : bool

This adds a player GameObject for this client. This causes an AddPlayer message to be sent to the server, and NetworkManager.OnServerAddPlayer is called. If an extra message was passed to AddPlayer, then OnServerAddPlayer will be called with a NetworkReader that contains the contents of the message.

ClearSpawners ( ) : void

This clears the registered spawn prefabs and spawn handler functions for this client.

ConnectLocalServer ( ) : NetworkClient

Create and connect a local client instance to the local server. This makes the client into a "host" - a client and server in the same process.

DestroyAllClientObjects ( ) : void

Destroys all networked objects on the client.

FindLocalObject ( NetworkInstanceId netId ) : GameObject

This finds the local NetworkIdentity object with the specified network Id.

Ready ( NetworkConnection conn ) : bool

Signal that the client connection is ready to enter the game.

RegisterPrefab ( GameObject prefab ) : void

Registers a prefab with the UNET spawning system.

RegisterPrefab ( GameObject prefab, NetworkHash128 newAssetId ) : void

Registers a prefab with the UNET spawning system.

RegisterPrefab ( GameObject prefab, SpawnDelegate spawnHandler, UnSpawnDelegate unspawnHandler ) : void

Registers a prefab with the UNET spawning system.

RegisterSpawnHandler ( NetworkHash128 assetId, SpawnDelegate spawnHandler, UnSpawnDelegate unspawnHandler ) : void

This is an advanced spawning function that registers a custom assetId with the UNET spawning system.

Private Methods

Method Description
ApplySpawnPayload ( NetworkIdentity uv, Vector3 position, byte payload, NetworkInstanceId netId, GameObject newGameObject ) : void
CheckForOwner ( NetworkIdentity uv ) : void
ClearLocalPlayers ( ) : void
GetPlayerController ( short playerControllerId, PlayerController &player ) : bool
GetStringForAssetId ( NetworkHash128 assetId ) : string
HandleClientDisconnect ( NetworkConnection conn ) : void
InternalAddPlayer ( NetworkIdentity view, short playerControllerId ) : void
OnClientAuthority ( NetworkMessage netMsg ) : void
OnLocalClientObjectDestroy ( NetworkMessage netMsg ) : void
OnLocalClientObjectHide ( NetworkMessage netMsg ) : void
OnLocalClientObjectSpawn ( NetworkMessage netMsg ) : void
OnLocalClientObjectSpawnScene ( NetworkMessage netMsg ) : void
OnObjectDestroy ( NetworkMessage netMsg ) : void
OnObjectSpawn ( NetworkMessage netMsg ) : void
OnObjectSpawnFinished ( NetworkMessage netMsg ) : void
OnObjectSpawnScene ( NetworkMessage netMsg ) : void
OnOwnerMessage ( NetworkMessage netMsg ) : void
OnRPCMessage ( NetworkMessage netMsg ) : void
OnSyncEventMessage ( NetworkMessage netMsg ) : void
OnSyncListMessage ( NetworkMessage netMsg ) : void
OnUpdateVarsMessage ( NetworkMessage netMsg ) : void
PrepareToSpawnSceneObjects ( ) : void
ReconnectLocalServer ( ) : NetworkClient
RegisterSystemHandlers ( NetworkClient client, bool localClient ) : void

Method Details

AddPlayer() public static method

This adds a player GameObject for this client. This causes an AddPlayer message to be sent to the server, and NetworkManager.OnServerAddPlayer is called. If an extra message was passed to AddPlayer, then OnServerAddPlayer will be called with a NetworkReader that contains the contents of the message.

public static AddPlayer ( NetworkConnection readyConn, short playerControllerId ) : bool
readyConn NetworkConnection The connection to become ready for this client.
playerControllerId short The local player ID number.
return bool

AddPlayer() public static method

This adds a player GameObject for this client. This causes an AddPlayer message to be sent to the server, and NetworkManager.OnServerAddPlayer is called. If an extra message was passed to AddPlayer, then OnServerAddPlayer will be called with a NetworkReader that contains the contents of the message.

public static AddPlayer ( NetworkConnection readyConn, short playerControllerId, MessageBase extraMessage ) : bool
readyConn NetworkConnection The connection to become ready for this client.
playerControllerId short The local player ID number.
extraMessage MessageBase An extra message object that can be passed to the server for this player.
return bool

AddPlayer() public static method

This adds a player GameObject for this client. This causes an AddPlayer message to be sent to the server, and NetworkManager.OnServerAddPlayer is called. If an extra message was passed to AddPlayer, then OnServerAddPlayer will be called with a NetworkReader that contains the contents of the message.

public static AddPlayer ( short playerControllerId ) : bool
playerControllerId short The local player ID number.
return bool

ClearSpawners() public static method

This clears the registered spawn prefabs and spawn handler functions for this client.

public static ClearSpawners ( ) : void
return void

ConnectLocalServer() public static method

Create and connect a local client instance to the local server. This makes the client into a "host" - a client and server in the same process.

public static ConnectLocalServer ( ) : NetworkClient
return NetworkClient

DestroyAllClientObjects() public static method

Destroys all networked objects on the client.

public static DestroyAllClientObjects ( ) : void
return void

FindLocalObject() public static method

This finds the local NetworkIdentity object with the specified network Id.

public static FindLocalObject ( NetworkInstanceId netId ) : GameObject
netId NetworkInstanceId The id of the networked object.
return UnityEngine.GameObject

Ready() public static method

Signal that the client connection is ready to enter the game.

public static Ready ( NetworkConnection conn ) : bool
conn NetworkConnection The client connection which is ready.
return bool

RegisterPrefab() public static method

Registers a prefab with the UNET spawning system.

public static RegisterPrefab ( GameObject prefab ) : void
prefab UnityEngine.GameObject A Prefab that will be spawned.
return void

RegisterPrefab() public static method

Registers a prefab with the UNET spawning system.

public static RegisterPrefab ( GameObject prefab, NetworkHash128 newAssetId ) : void
prefab UnityEngine.GameObject A Prefab that will be spawned.
newAssetId NetworkHash128 An assetId to be assigned to this prefab. This allows a dynamically created game object to be registered for an already known asset Id.
return void

RegisterPrefab() public static method

Registers a prefab with the UNET spawning system.

public static RegisterPrefab ( GameObject prefab, SpawnDelegate spawnHandler, UnSpawnDelegate unspawnHandler ) : void
prefab UnityEngine.GameObject A Prefab that will be spawned.
spawnHandler SpawnDelegate A method to use as a custom spawnhandler on clients.
unspawnHandler UnSpawnDelegate A method to use as a custom un-spawnhandler on clients.
return void

RegisterSpawnHandler() public static method

This is an advanced spawning function that registers a custom assetId with the UNET spawning system.

public static RegisterSpawnHandler ( NetworkHash128 assetId, SpawnDelegate spawnHandler, UnSpawnDelegate unspawnHandler ) : void
assetId NetworkHash128 Custom assetId string.
spawnHandler SpawnDelegate A method to use as a custom spawnhandler on clients.
unspawnHandler UnSpawnDelegate A method to use as a custom un-spawnhandler on clients.
return void