C# Class UnityEngine.Networking.ClientScene

A client manager which contains static client information and functions.

Afficher le fichier Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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.
Résultat bool

AddPlayer() public static méthode

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.
Résultat bool

AddPlayer() public static méthode

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.
Résultat bool

ClearSpawners() public static méthode

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

public static ClearSpawners ( ) : void
Résultat void

ConnectLocalServer() public static méthode

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
Résultat NetworkClient

DestroyAllClientObjects() public static méthode

Destroys all networked objects on the client.

public static DestroyAllClientObjects ( ) : void
Résultat void

FindLocalObject() public static méthode

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.
Résultat UnityEngine.GameObject

Ready() public static méthode

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.
Résultat bool

RegisterPrefab() public static méthode

Registers a prefab with the UNET spawning system.

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

RegisterPrefab() public static méthode

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.
Résultat void

RegisterPrefab() public static méthode

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.
Résultat void

RegisterSpawnHandler() public static méthode

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.
Résultat void