Example #1
0
        public void StopClient()
        {
            if (LogFilter.Debug)
            {
                Debug.Log("NetworkManager StopClient");
            }
            isNetworkActive = false;
            if (client != null)
            {
                // only shutdown this client, not ALL clients.
                client.Disconnect();
                client.Shutdown();
                client = null;
            }

            ClientScene.DestroyAllClientObjects();
            if (!string.IsNullOrEmpty(offlineScene))
            {
                ClientChangeScene(offlineScene, false);
            }
            CleanupNetworkIdentities();
            OnStopClient();
        }