Method group is Obsolete

ClientScene

class in UnityEngine.Networking

Switch to Manual
Obsolete

Description

A client manager which contains static client information and functions.

This manager contains references to tracked static local objects such as spawner registrations. It also has the default message handlers used by clients when they registered none themselves. The manager handles adding/removing player objects to the game after a client connection has been set as ready.

The ClientScene is a singleton, and it has static convenience methods such as ClientScene.Ready().

The ClientScene is used by the NetworkManager, but it can be used by itself.

As the ClientScene manages player objects on the client, it is where clients request to add players. The NetworkManager does this via the ClientScene automatically when auto-add-players is set, but it can be done through code using the function ClientScene.AddPlayer(). This sends an AddPlayer message to the server and will cause a player object to be created for this client.

Like NetworkServer, the ClientScene understands the concept of the local client. The function ClientScene.ConnectLocalServer() is used to become a host by starting a local client (when a server is already running).

Static Functions

SetLocalObjectNetId is a unique number assigned to all objects with NetworkIdentity components in a game.