using UnityEngine; /* Documentation: https://mirror-networking.gitbook.io/docs/components/network-manager API Reference: https://mirror-networking.com/docs/api/Mirror.NetworkManager.html */ namespace Mirror.Examples.Basic { [AddComponentMenu("")] public class BasicNetManager : NetworkManager { /// /// Called on the server when a client adds a new player with NetworkClient.AddPlayer. /// The default implementation for this function creates a new player object from the playerPrefab. /// /// Connection from client. public override void OnServerAddPlayer(NetworkConnectionToClient conn) { base.OnServerAddPlayer(conn); Player.ResetPlayerNumbers(); } /// /// Called on the server when a client disconnects. /// This is called on the Server when a Client disconnects from the Server. Use an override to decide what should happen when a disconnection is detected. /// /// Connection from client. public override void OnServerDisconnect(NetworkConnectionToClient conn) { base.OnServerDisconnect(conn); Player.ResetPlayerNumbers(); } } }