public void Disconnect() { if (isServer) { networkManager.StopHost(); Debug.Log("server"); } if (isClient) { Debug.Log("client"); networkManager.StopClient(); } }
public void Disconnect() { NetworkIdentity identity = player.networkConnection.identity; if (identity.isServer) { networkManager.StopHost(); } if (identity.isClient) { networkManager.StopClient(); } }
public void Disconnect() { // A client apparently doesn't know it's own connectionId, so we will use that // as a proxy to determine whether we are the client or the server. NetworkConnection connection = player.networkConnection; if (connection != null) { networkManager.StopHost(); } else { networkManager.StopClient(); } }