コード例 #1
0
ファイル: UIDeviceSelector.cs プロジェクト: Smoothstep/VRChat
    // Token: 0x06006154 RID: 24916 RVA: 0x00224F84 File Offset: 0x00223384
    public void SelectNextMic()
    {
        bool flag     = string.IsNullOrEmpty(VRCInputManager.micDeviceName);
        int  deviceID = (!flag) ? (USpeaker.GetInputDeviceID() + 1) : 0;
        bool flag2    = USpeaker.TrySetInputDevice(deviceID);

        if (flag2)
        {
            VRCInputManager.micDeviceName = USpeaker.GetInputDeviceName();
        }
        else
        {
            VRCInputManager.micDeviceName = string.Empty;
            USpeaker.SetInputDevice(0);
        }
        this.RefreshLabel();
    }
コード例 #2
0
 // Token: 0x06004CC6 RID: 19654 RVA: 0x0019BBD8 File Offset: 0x00199FD8
 private void OnGUI()
 {
     if (Network.peerType == NetworkPeerType.Disconnected)
     {
         if (GUI.Button(new Rect(10f, 10f, 100f, 30f), "Connect"))
         {
             Network.Connect(this.remoteIP, this.remotePort);
         }
         if (GUI.Button(new Rect(10f, 50f, 100f, 30f), "Start Server"))
         {
             Network.InitializeServer(32, this.listenPort, true);
         }
         this.remoteIP   = GUI.TextField(new Rect(120f, 10f, 100f, 20f), this.remoteIP);
         this.remotePort = int.Parse(GUI.TextField(new Rect(230f, 10f, 40f, 20f), this.remotePort.ToString()));
     }
     else
     {
         if (GUI.Button(new Rect(10f, 10f, 100f, 50f), "Disconnect"))
         {
             Network.Disconnect(200);
         }
         GUILayout.BeginArea(new Rect(10f, 60f, 200f, 500f));
         int num = 0;
         foreach (string text in Microphone.devices)
         {
             if (GUILayout.Button(text, new GUILayoutOption[]
             {
                 GUILayout.Width(200f)
             }))
             {
                 USpeaker.SetInputDevice(num);
             }
             num++;
         }
         GUILayout.EndArea();
     }
 }
コード例 #3
0
    void OnGUI()
    {
        if (Network.peerType == NetworkPeerType.Disconnected)
        {
            if (GUI.Button(new Rect(10, 10, 100, 30), "Connect"))
            {
                Network.Connect(remoteIP, remotePort);
            }
            if (GUI.Button(new Rect(10, 50, 100, 30), "Start Server"))
            {
                Network.InitializeServer(32, listenPort, true);
            }

            remoteIP   = GUI.TextField(new Rect(120, 10, 100, 20), remoteIP);
            remotePort = int.Parse(GUI.TextField(new Rect(230, 10, 40, 20), remotePort.ToString()));
        }
        else
        {
            if (GUI.Button(new Rect(10, 10, 100, 50), "Disconnect"))
            {
                Network.Disconnect(200);
            }

            GUILayout.BeginArea(new Rect(10, 60, 200, 500));
            int idx = 0;
            foreach (string mic in Microphone.devices)
            {
                if (GUILayout.Button(mic, GUILayout.Width(200f)))
                {
                    USpeaker.SetInputDevice(idx);
                }
                idx++;
            }
            GUILayout.EndArea();
        }
    }