added microphone selection box
parent
20fcf118bd
commit
be8888cf31
|
|
@ -10,8 +10,8 @@ public class NetworkGUI : MonoBehaviour
|
||||||
public InputField roomInput;
|
public InputField roomInput;
|
||||||
public Text messages;
|
public Text messages;
|
||||||
public List<string> messageBuffer;
|
public List<string> messageBuffer;
|
||||||
|
public Dropdown microphones;
|
||||||
|
Dissonance.DissonanceComms comms;
|
||||||
public void handleSend()
|
public void handleSend()
|
||||||
{
|
{
|
||||||
if(sendInput.text != "")
|
if(sendInput.text != "")
|
||||||
|
|
@ -39,6 +39,8 @@ public class NetworkGUI : MonoBehaviour
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
comms = GameObject.FindObjectOfType<Dissonance.DissonanceComms>();
|
||||||
|
microphones.AddOptions(new List<string>(Microphone.devices));
|
||||||
networkManager.messageReceived += (m) => {
|
networkManager.messageReceived += (m) => {
|
||||||
string s = m.type + ":" + m.sender +":" + m.text;
|
string s = m.type + ":" + m.sender +":" + m.text;
|
||||||
messageBuffer.Add(s);
|
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
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -275,8 +275,8 @@ MonoBehaviour:
|
||||||
m_Calls:
|
m_Calls:
|
||||||
- m_Target: {fileID: 244561621}
|
- m_Target: {fileID: 244561621}
|
||||||
m_TargetAssemblyTypeName: NetworkGUI, Assembly-CSharp
|
m_TargetAssemblyTypeName: NetworkGUI, Assembly-CSharp
|
||||||
m_MethodName: onMicrophoneChanged
|
m_MethodName: handleMicrophoneSelection
|
||||||
m_Mode: 5
|
m_Mode: 1
|
||||||
m_Arguments:
|
m_Arguments:
|
||||||
m_ObjectArgument: {fileID: 0}
|
m_ObjectArgument: {fileID: 0}
|
||||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||||
|
|
@ -630,6 +630,7 @@ MonoBehaviour:
|
||||||
roomInput: {fileID: 711524768}
|
roomInput: {fileID: 711524768}
|
||||||
messages: {fileID: 1894247854}
|
messages: {fileID: 1894247854}
|
||||||
messageBuffer: []
|
messageBuffer: []
|
||||||
|
microphones: {fileID: 117638564}
|
||||||
--- !u!1 &440509381
|
--- !u!1 &440509381
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue