UnityEngine.Networking.NetworkManager.IsClientConnected C# (CSharp) Method

IsClientConnected() public method

This checks if the NetworkManager has a client and that it is connected to a server.

public IsClientConnected ( ) : bool
return bool
        public bool IsClientConnected()
        {
            return ((this.client != null) && this.client.isConnected);
        }

Usage Example

Example #1
0
        void HostGame()
        {
            if (!_networkManager.IsClientConnected() && !NetworkServer.active)
            {
                if (_noConnection)
                {
                    _networkManager.StartHost();
                }


                // If our client hasn't connected to the server, and the server isn't active...
                // And no connections have been made yet, start a host!
            }
        }
All Usage Examples Of UnityEngine.Networking.NetworkManager::IsClientConnected