private IEnumerator Start() { sphinx = FindObjectOfType <SphinxExample>(); sphinx.OnSpeechRecognized += UpdateUI; // Wait until the mic is initialized before we setup the UI. while (sphinx.mic == null) { yield return(null); } SetupUI(); }
private IEnumerator InitMicrophone() { sphinx = FindObjectOfType <SphinxExample>(); sphinx.OnSpeechRecognized += UpdateSpeechUI; uiManager.UpdateMicIndicator(new Color(1, 0, 0, 1)); while (sphinx.mic == null) { yield return(null); } Debug.Log($"<color=green><b>Connected to: {sphinx.mic.Name}</b></color>"); uiManager.micConnected = true; uiManager.UpdateMicIndicator(new Color(0, 1, 0, 1)); }