// Use this for initialization void Start() { Debug.Log("Register Voice Manager"); controlPanelManager = ControlPanelManager.Instance(); keywordToActionDict.Add("Reset world", () => { // Call the OnReset method on every descendant object. this.BroadcastMessage("OnClearAllAnalysisTextMessages"); }); keywordToActionDict.Add("Turn On Visual analysis", () => { Debug.Log("turn on visual analysis"); controlPanelManager.ChangeVisualAnalysisStatus("ON"); }); keywordToActionDict.Add("Help me avoid soda", () => { Debug.Log("Help me avoid soda"); controlPanelManager.ChangeVisualAnalysisStatus("ON"); }); keywordToActionDict.Add("Turn Off Visual analysis", () => { Debug.Log("turn off visual analysis"); controlPanelManager.ChangeVisualAnalysisStatus("OFF"); }); // Tell the KeywordRecognizer about our keywordToActionDict. keywordRecognizer = new KeywordRecognizer(keywordToActionDict.Keys.ToArray()); // Register a callback for the KeywordRecognizer and start recognizing! keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized; keywordRecognizer.Start(); }
void TurnVisualAnalysis(string signal) { isVisualAnalysisOn = !isVisualAnalysisOn; controlPanelManager.ChangeVisualAnalysisStatus(signal); }