Ejemplo n.º 1
0
 public void OnWord(KeywordRecognizedEventArgs args)
 {
     if (string.Equals(args.text, KeyWord, StringComparison.OrdinalIgnoreCase))
     {
         OnKeyword();
     }
 }
        private void OnKeyWord(KeywordRecognizedEventArgs args)
        {
            if (SequenceElements[curIdx].VoiceCommand.Equals(args.text))
            {
                StartCoroutine("FadeAndContinue");
            }

            if (ResetVoiceCommand.Equals(args.text))
            {
                StopCoroutine("PlaySequence");

                if (spawnedPrefab != null)
                {
                    GameObject.Destroy(spawnedPrefab);
                    spawnedPrefab = null;
                }

                StartCoroutine("PlaySequence", 0);
            }

            if (RepeatStepCommand.Equals(args.text))
            {
                if (spawnedPrefab != null)
                {
                    GameObject.Destroy(spawnedPrefab);
                    spawnedPrefab = null;
                }

                RepeatStep();
            }
        }
 public void KeywordHandler(KeywordRecognizedEventArgs args)
 {
     Debug.Log("Keyword handler called in " + name + " for keyword " + args.text + " with confidence level " + args.confidence);
     // Send a pressed message to the button through the InteractionManager
     // (This will ensure InteractionReceivers also receive the event)
     // TEMP use a send message event
     gameObject.SendMessageUpwards("OnTapped", SendMessageOptions.DontRequireReceiver);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// The Speech callback.
 /// </summary>
 /// <param name="args"></param>
 private void OnWord(KeywordRecognizedEventArgs args)
 {
     if (args.text == OpenMenuKeyword)
     {
         Activate();
     }
     else if (args.text == CloseMenuKeyword)
     {
         Deactivate();
     }
 }
Ejemplo n.º 5
0
        // --------------------------------------------------------------------------------

        #region Private Functions

        private void OnKeyWord(KeywordRecognizedEventArgs args)
        {
            SetActive(!m_bActive);

            if (m_ShowHelpText.Equals(args.text) && (int)ConfidenceThreshold > (int)args.confidence)
            {
                SetActive(true);
            }
            else if (m_HideHelpText.Equals(args.text) && (int)ConfidenceThreshold > (int)args.confidence)
            {
                SetActive(false);
            }
        }
 /// <summary>
 /// The speech callback.
 /// </summary>
 /// <param name="args"></param>
 private void OnWord(KeywordRecognizedEventArgs args)
 {
     if (args.text == OpenLogKeyword)
     {
         Activate();
     }
     else if (args.text == CloseLogKeyword)
     {
         Deactivate();
     }
     else if (args.text == ScrollUpKeyword)
     {
         OnScrollAmount(5);
     }
     else if (args.text == ScrollDownKeyword)
     {
         OnScrollAmount(-5);
     }
     else if (args.text == GoToTopKeyword)
     {
         OnScrollPosition(1);
     }
     else if (args.text == GoToBottomKeyword)
     {
         OnScrollPosition(0);
     }
     else if (args.text == ShowMessagesKeyword)
     {
         FilterLogs = false;
     }
     else if (args.text == HideMessagesKeyword)
     {
         FilterLogs = true;
     }
     else if (args.text == ToggleMessagesKeyword)
     {
         OnClickFilterLogs();
     }
     else if (args.text == ShowWarningsKeyword)
     {
         FilterWarnings = false;
     }
     else if (args.text == HideWarningsKeyword)
     {
         FilterWarnings = true;
     }
     else if (args.text == ToggleWarningsKeyword)
     {
         OnClickFilterWarnings();
     }
     else if (args.text == ShowErrorsKeyword)
     {
         FilterErrors = false;
     }
     else if (args.text == HideErrorsKeyword)
     {
         FilterErrors = true;
     }
     else if (args.text == ToggleErrorsKeyword)
     {
         OnClickFilterErrors();
     }
     else if (args.text == ClearLogKeyword)
     {
         ClearLog();
     }
 }