private void OnGamePlayerDisconnected(UnityEngine.Networking.NetworkConnection conn) { if (DEBUG) { Debug.Log("OnPlayerDisconnected"); } ConnectedPlayerCount--; if (OnPlayerDisconnectEvent != null) { OnPlayerDisconnectEvent(); } foreach (var lobbyPlayer in GameObject.FindObjectsOfType <NetworkCompat.NetworkLobbyPlayer> ()) { if (lobbyPlayer.serverId == conn.connectionId) { lobbyPlayer.playingGame = false; } } if (AreAllGamePlayersLoaded()) { if (OnAllPlayersLoadedEvent != null) { OnAllPlayersLoadedEvent(); } } if (CurrentState().Equals(ServerLifecycle.ProcessState.CountingDown)) { _networkLobbyManager.AllClientsCancelGameCountdown("not enough players"); CancelInvoke(); } if (ConnectedPlayerCount < MIN_REQ_PLAYERS) { _innerProcess.MoveNext(Command.TooFewPlayersRemaining); } OnStateUpdate(); }