private void Disconnect() { if (isConnected) { isConnected = false; tcp.GetSocket().Close(); udp.GetSocket().Close(); Debug.Log("Disconnected from server"); } }