Пример #1
0
    void Update()
    {
        if (!_mumbleClient.ReadyToConnect)
        {
            return;
        }
        if (Input.GetKeyDown(KeyCode.S))
        {
            _mumbleClient.SendTextMessage("This is an example message from Unity");
            print("Sent mumble message");
        }
        if (Input.GetKeyDown(KeyCode.J))
        {
            print("Will attempt to join channel " + ChannelToJoin);
            _mumbleClient.JoinChannel(ChannelToJoin);
        }
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            print("Will join root");
            _mumbleClient.JoinChannel("Root");
        }
        if (Input.GetKeyDown(KeyCode.C))
        {
            print("Will set our comment");
            _mumbleClient.SetOurComment("Example Comment");
        }
        if (Input.GetKeyDown(KeyCode.B))
        {
            print("Will set our texture");
            byte[] commentHash = new byte[] { 1, 2, 3, 4, 5, 6 };
            _mumbleClient.SetOurTexture(commentHash);
        }

        // You can use the up / down arrows to increase/decrease
        // the bandwidth used by the mumble mic
        const int BandwidthChange = 5000;

        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            int currentBW  = MyMumbleMic.GetBitrate();
            int newBitrate = currentBW + BandwidthChange;
            Debug.Log("Increasing bitrate " + currentBW + "->" + newBitrate);
            MyMumbleMic.SetBitrate(newBitrate);
        }
        if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            int currentBW  = MyMumbleMic.GetBitrate();
            int newBitrate = currentBW - BandwidthChange;
            Debug.Log("Decreasing bitrate " + currentBW + "->" + newBitrate);
            MyMumbleMic.SetBitrate(newBitrate);
        }
    }