private void Update() { bool noConnection = (manager.client == null || manager.client.connection == null || manager.client.connection.connectionId == -1); if (!manager.IsClientConnected() && !NetworkServer.active) { if (noConnection) { menu.SetActive(true); connectingPanel.SetActive(false); } else { menu.SetActive(false); connectingPanel.SetActive(true); ipAddress.text = "Connecting to " + manager.networkAddress + " : " + manager.networkPort + ".."; } } if (NetworkServer.active || manager.IsClientConnected()) { menu.SetActive(false); connectingPanel.SetActive(false); } }
private void Update() { bool noConnection = (manager.client == null || manager.client.connection == null || manager.client.connection.connectionId == -1); if (!manager.IsClientConnected() && !NetworkServer.active) { if (noConnection) { connectingPanel.SetActive(false); #if UNITY_ANDROID || UNITY_IOS hudVive.SetActive(false); hudMobile.SetActive(true); #else hudMobile.SetActive(false); hudVive.SetActive(true); #endif } else { hudMobile.SetActive(false); connectingPanel.SetActive(true); ipAddress.text = "Connecting to " + manager.networkAddress + " : " + manager.networkPort + ".."; } } if (NetworkServer.active || manager.IsClientConnected()) { connectingPanel.SetActive(false); #if UNITY_ANDROID || UNITY_IOS hudMobile.SetActive(false); #else hudVive.SetActive(false); #endif } }