NetManager is a MonoSingleton. It contains a Client and manages connection and requests with it.
Version is the
Application.version. It is sent to the server at connection. The first connected client defines the server version with it. After, all other clients must have the same version.
Connection to a server
First, instantiate a GameObject with a
NetManager component (or create it in a scene).
Auto connect is checked, it logins on start. (used in development)
bool success = await NetManager.Connect(address, port, password, version);
version is null or empty,
Application.version is used.
Client gets disconnected when NetManager is destroyed or if you call the
Host priority is a number [0:255]. It can be used to defines who is the hosters. (less priority = host).
// Get a list of players IDs. NetManager.GetPeerIdList();
// Get Latency. NetManager.GetLatency(); NetManager.GetLatency(int peerId);
// Get a list of Host priorities. NetManager.GetHostsPriorityList();
// Get main Cloud NetManager.GetCloud();
// get the Client object NetManager.GetClient();
// Get local peer Id NetManager.GetPeerId();
// Get the scene ID from asset ID NetManager.GetSUIDFromGUID(string guid);