added microphone selection box

handTracking
Kyle Johnsen 2022-01-05 00:27:05 -05:00
parent 20fcf118bd
commit be8888cf31
2 changed files with 12 additions and 4 deletions

View File

@ -10,8 +10,8 @@ public class NetworkGUI : MonoBehaviour
public InputField roomInput;
public Text messages;
public List<string> messageBuffer;
public Dropdown microphones;
Dissonance.DissonanceComms comms;
public void handleSend()
{
if(sendInput.text != "")
@ -39,6 +39,8 @@ public class NetworkGUI : MonoBehaviour
// Start is called before the first frame update
void Start()
{
comms = GameObject.FindObjectOfType<Dissonance.DissonanceComms>();
microphones.AddOptions(new List<string>(Microphone.devices));
networkManager.messageReceived += (m) => {
string s = m.type + ":" + m.sender +":" + m.text;
messageBuffer.Add(s);
@ -58,6 +60,11 @@ public class NetworkGUI : MonoBehaviour
};
}
public void handleMicrophoneSelection()
{
comms.MicrophoneName = microphones.options[microphones.value].text;
}
// Update is called once per frame
void Update()
{

View File

@ -275,8 +275,8 @@ MonoBehaviour:
m_Calls:
- m_Target: {fileID: 244561621}
m_TargetAssemblyTypeName: NetworkGUI, Assembly-CSharp
m_MethodName: onMicrophoneChanged
m_Mode: 5
m_MethodName: handleMicrophoneSelection
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@ -630,6 +630,7 @@ MonoBehaviour:
roomInput: {fileID: 711524768}
messages: {fileID: 1894247854}
messageBuffer: []
microphones: {fileID: 117638564}
--- !u!1 &440509381
GameObject:
m_ObjectHideFlags: 0