using TMPro; using UnityEngine; public class MicrophoneStand : MonoBehaviour { public TextMeshProUGUI outputText; public GameObject microphoneOffStatus; public GameObject microphoneOnStatus; public FMODWhisperBridge fmodWhisperBridge; // Start is called before the first frame update void Start() { fmodWhisperBridge.OnWhisperResultProcessed += OnWhisperResult; microphoneOffStatus.SetActive(true); microphoneOnStatus.SetActive(false); } // Update is called once per frame void Update() { } void OnTriggerEnter(Collider other) { KbmController controller = other.GetComponent(); Debug.Log("Mic stand collided with object " + other.gameObject.name); if (controller != null || other.gameObject.tag == "Player Head") { microphoneOffStatus.SetActive(false); microphoneOnStatus.SetActive(true); fmodWhisperBridge.ActivateRecording(); } } private void OnTriggerExit(Collider other) { KbmController controller = other.GetComponent(); if (controller != null | other.gameObject.tag == "Player Head") { microphoneOffStatus.SetActive(true); microphoneOnStatus.SetActive(false); fmodWhisperBridge.DeactivateRecording(); } } private void OnWhisperResult(string result) { outputText.text = result; } public string GetTextOutput() { return outputText.text; } }