// void BtnStartExperiment()
    // {
    //     EExperimentStatus expStatus = Exp.GetExperimentStatus();
    //     Debug.Assert(expStatus == EExperimentStatus.Waiting);
    //     // Exp.StartExperiment();
    // }

    // void BtnAbortExperiment()
    // {
    //     EExperimentStatus expStatus = Exp.GetExperimentStatus();
    //     Debug.Assert(expStatus != EExperimentStatus.Waiting);
    //     Exp.AbortExperiment();
    // }

    void RefreshUI()
    {
        ENetworkState     netState  = NetMan.GetState();
        EExperimentStatus expStatus = Exp.GetExperimentStatus();

        BtnStartServer.gameObject.SetActive(netState == ENetworkState.Closed);
        BtnStartClient.gameObject.SetActive(netState == ENetworkState.Closed);
        BtnAbortClose.gameObject.SetActive(netState == ENetworkState.Running || netState == ENetworkState.Startup);
        PreviousNetState = netState;

        // if (NetMan.IsServer())
        // {
        //     BtnStartExp.gameObject.SetActive(expStatus == EExperimentStatus.Waiting && NetMan.GetNumConnections() == 1);
        //     BtnAbortExp.gameObject.SetActive(expStatus != EExperimentStatus.Waiting);
        // }
        // else
        // {
        //     // BtnStartExp.gameObject.SetActive(false);
        //     // BtnAbortExp.gameObject.SetActive(false);
        // }
        PreviousExpStatus    = expStatus;
        bPreviousServerState = NetMan.IsServer();

        NetworkState.text    = (netState != ENetworkState.Closed ? (NetMan.IsServer() ? "Server - " : "Client - ") : "") + netState.ToString();
        ExperimentState.text = expStatus.ToString();

        ClientList.text = "";
        string[] conns = NetMan.NetComp.GetConnectionNames();
        foreach (string name in conns)
        {
            ClientList.text += name + "\n";
        }
    }