Ejemplo n.º 1
0
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     if (!isDestroyed && eventData.RecognizedText.ToLowerInvariant().Equals(destructionKeyword))
     {
         DestroyStatue();
     }
 }
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        switch (eventData.RecognizedText)
        {
        case "Set Value":
            SetRelevantPoint(pointofInterest, "POI");
            break;

        case "Set Danger":
            SetRelevantPoint(danger, "DAN");
            break;

        case "Mark Object":
            SetRelevantPoint(remark, "REM");
            break;

        case "Take Picture":
            cameraManager.takePhoto();
            break;

        case "Fire Start":
            flareMobile.SetActive(true);
            readSchadenPrice.enablePriceView();
            break;

        case "Fire Stop":
            flareMobile.SetActive(false);
            readSchadenPrice.disablePriceView();
            break;

        case "Set Focus":
            cameraManager.setFocus(raycastCollissions.lastCollide);
            break;
        }
    }
Ejemplo n.º 3
0
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     if (eventData.RecognizedText.ToLower().Equals(COMMAND_ROTATE))
     {
         RegisterForRotation();
     }
 }
Ejemplo n.º 4
0
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        string myWord = eventData.RecognizedText.ToLower();

        switch (myWord)
        {
        case "mahalo":
        case "hello":
            Debug.Log("Recieved a " + myWord + " keyword");
            gameObject.GetComponent <MeshRenderer>().material.color = Color.blue;
            mahalo = true;
            break;

        case "start camera":
            Debug.Log("Recieved start camera keyword");
            StartCamera();
            break;

        case "stop camera":
            Debug.Log("Recieved stop camera keyword");
            StartCamera();
            break;

        default:
            break;
        }
    }
Ejemplo n.º 5
0
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        string keyword = eventData.RecognizedText.ToLower();

        switch (keyword)
        {
        case COMMAND_RESET:
            resetScene();
            return;

        case COMMAND_CANCEL:
            cancelDrawing();
            break;
        }

        if (IsInStreetViewMode)
        {
            // allowable voice commands in streetviewmode
            switch (keyword)
            {
            case StreetViewManager.COMMAND_EXIT_STREET_VIEW:
                StreetViewManager.Instance.ExitStreetView();
                break;
            } // end switch
        }
        else
        {
            // allowable voice commands in normal mode
            switch (keyword)
            {
            case COMMAND_MOVE_MAP:
                moveMap();
                break;

            case COMMAND_SCALE_MAP:
                registerMapForScaling();
                break;

            case COMMAND_SHOW_TOOLS:
                showTools();
                break;

            case COMMAND_HIDE_TOOLS:
                HideTools();
                break;

            case COMMAND_ROTATE_MAP:
                registerMapForRotation();
                break;

            case COMMAND_DRAW_POLYGON:
                enterDrawingMode();
                break;

            default:
                // just ignore
                break;
            } // end switch
        }
    }
        protected override void Start()
        {
            base.Start();

            speechKeywordRecognizedEventData = new SpeechKeywordRecognizedEventData(EventSystem.current);

            keywords = new List <KeywordAndKeyCode>
            {
                new KeywordAndKeyCode {
                    Keyword = AdjustKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = CancelKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = ConfirmKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = PlaceMenuPinKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = HideHoloBarKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = NextKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = OpenMenuKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = PreviousKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = RemoveKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = ShowHoloBarKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = StartSlideshowKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = StopSlideshowKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = ExpandKeyword, KeyCode = 0
                },
                new KeywordAndKeyCode {
                    Keyword = CollapseKeyword, KeyCode = 0
                }
            };

            int keywordCount = keywords.Count;

            if (keywordCount > 0)
            {
                SetupKeywordRecognizer();
                keywordRecognizer.Start();
            }
        }
Ejemplo n.º 7
0
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     if (eventData.RecognizedText == "Rotate")
     {
         StartRotate();
     }
     else if (eventData.RecognizedText == "Stop Gallery")
     {
         StopRotate();
     }
     else if (eventData.RecognizedText == "Tutor Help")
     {
         help.SetActive(true);
     }
     else if (eventData.RecognizedText == "Dismiss Help")
     {
         help.SetActive(false);
     }
     else
     {
         gallery.SetActive(false);
         GlobalKeys.SpokenCommand = eventData.RecognizedText;
         SceneLoader.Instance.LoadScene("ShapeExplorer");
     }
 }
Ejemplo n.º 8
0
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     if (eventData.RecognizedText.ToLower() == "come on")
     {
         //めんどくさいのでとりあえず引数ヌル渡して同じ関数呼び出す
         OnInputClicked(null);
     }
 }
Ejemplo n.º 9
0
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     switch (eventData.RecognizedText.ToLower())
     {
     case "dump mesh":
         SceneManager.LoadScene(1);
         break;
     }
 }
Ejemplo n.º 10
0
        public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
        {
            var keyword = eventData.RecognizedText;

            if (keyword.Equals(levitationKeyword))
            {
                OnLevitation();
            }
        }
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     switch (eventData.RecognizedText.ToLower())
     {
     case COMMAND_SCALE:
         RegisterForScaling();
         break;
     }
 }
Ejemplo n.º 12
0
        public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
        {
            var keyword = eventData.RecognizedText.ToLowerInvariant();

            if (keyword.Equals(startDictationKeyword))
            {
                BeginDictation();
            }
        }
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     switch (eventData.RecognizedText)
     {
     case "Load Snap":
         StartCoroutine(LoadSnap());
         break;
     }
 }
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     switch (eventData.RecognizedText.ToLower())
     {
     case "take picture":
         GetfromURL("http://localhost/api/holographic/mrc/files");
         break;
     }
 }
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     switch (eventData.RecognizedText.ToLower())
     {
     case "done":
         SetSpatialMap();
         break;
     }
 }
Ejemplo n.º 16
0
        /// <summary>
        /// If the parent is being gazed at and the keyword is in the keyword dictionary, invokes the corresponding callback.
        /// </summary>
        private void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
        {
            Debug.Log(String.Format("Keywords recognized : {0}", eventData.RecognizedText));

            Action action;

            if (keywords.TryGetValue(eventData.RecognizedText.ToLower(), out action))
            {
                action.Invoke();
            }
        }
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     switch (eventData.RecognizedText.ToLower())
     {
     case "reset all":
         foreach (Renderer renderer in GetComponentsInChildren <Renderer>())
         {
             renderer.material.color = Color.gray;
         }
         break;
     }
 }
Ejemplo n.º 18
0
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     switch (eventData.RecognizedText.ToLower())
     {
     case "reset all":
         foreach (Material cachedChildMaterial in cachedChildMaterials)
         {
             cachedChildMaterial.SetColor("_Color", Color.gray);
         }
         break;
     }
 }
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        switch (eventData.RecognizedText.ToLower())
        {
        case COMMAND_DELETE:
            deleteThisObject();
            break;

        default:
            // ignore
            break;
        }
    }
Ejemplo n.º 20
0
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        switch (eventData.RecognizedText.ToLower())
        {
        case StreetViewManager.COMMAND_STREET_VIEW:
            setUpStreetView();
            break;

        case PinnedLocationManager.COMMAND_PIN_LOCATION:
            pinGazedLocation();
            break;
        }
    }
Ejemplo n.º 21
0
 public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
 {
     switch (eventData.RecognizedText.ToLower())
     {
     case "toggle mesh":
         Debug.Log("before " + SpatialUnderstanding.Instance.UnderstandingCustomMesh.DrawProcessedMesh);
         SpatialUnderstanding.Instance.UnderstandingCustomMesh.DrawProcessedMesh =
             !SpatialUnderstanding.Instance.UnderstandingCustomMesh.DrawProcessedMesh;
         Debug.Log("Mesh Toggled");
         Debug.Log("after " + SpatialUnderstanding.Instance.UnderstandingCustomMesh.DrawProcessedMesh);
         break;
     }
 }
        /// <summary>
        /// If the parent is being gazed at and the keyword is in the keyword dictionary, invokes the corresponding callback.
        /// </summary>
        private void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
        {
            if (gazeObserver != null && gazeObserver.IsGazed)
            {
                Debug.Log(String.Format("Keywords recognized : {0}", eventData.RecognizedText));

                Action action;
                if (voiceCommands.TryGetValue(eventData.RecognizedText.ToLower(), out action))
                {
                    action.Invoke();
                }
            }
        }
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        switch (eventData.RecognizedText.ToLower())
        {
        case COMMAND_SHOW_DETAILS:
            ShowTable();
            break;

        case COMMAND_HIDE_DETAILS:
            HideTable();
            break;
        }
    }
Ejemplo n.º 24
0
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        switch (eventData.RecognizedText.ToLower())
        {
        case "main menu":
            SceneManager.LoadScene(0);
            break;

        case "rooms menu":
            SceneManager.LoadScene(2);
            break;
        }
    }
Ejemplo n.º 25
0
        /// <summary>
        /// If the parent is being gazed at and the keyword is in the keyword dictionnary, invokes the corresponding callback.
        /// </summary>
        private void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
        {
            GazeObserver gazeObserver = transform.GetComponentInParent <GazeObserver>();

            if (gazeObserver != null && gazeObserver.IsGazed)
            {
                Debug.Log(String.Format("Keywords recognized : {0}", eventData.RecognizedText));

                Action action;
                if (keywords.TryGetValue(eventData.RecognizedText.ToLower(), out action))
                {
                    action.Invoke();
                }
            }
        }
Ejemplo n.º 26
0
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        var voiceCommand = eventData.RecognizedText.ToLower();

        switch (voiceCommand)
        {
        case "scan complete":
        {
            SpatialMappingManager.Instance.DrawVisualMeshes = false;
            IOTCollection.SetActive(true);
            IOTCollection.transform.parent = spatialMapping.transform;
        }
        break;
        }
    }
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        switch (eventData.RecognizedText.ToLower())
        {
        case "show connect code":

            Debug.Log("tried show connect code");
            if (ConnectCodeTextMesh.gameObject.activeSelf == false)
            {
                StartCoroutine(DisplayForSeconds(10));
                Debug.Log("show connect code");
            }
            break;
        }
    }
Ejemplo n.º 28
0
        public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
        {
            switch (eventData.RecognizedText.ToLower())
            {
            case "initialize":
                AssumeGameMaster();
                break;

            case "start":
                PlayGame();
                break;

            default:
                break;
            }
        }
Ejemplo n.º 29
0
        public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
        {
            var keyword = eventData.RecognizedText;

            if (keyword.Equals(greetingKeyword))
            {
                OnGreeting();
            }
            else if (keyword.Equals(scoldKeyword))
            {
                OnScold();
            }
            else if (keyword.Equals(actionKeyword))
            {
                OnAction();
            }
        }
Ejemplo n.º 30
0
    public void OnSpeechKeywordRecognized(SpeechKeywordRecognizedEventData eventData)
    {
        switch (eventData.RecognizedText.ToLower())
        {
        case "finish scan":
            FinishScan();
            break;

        case "main menu":
            SpatialUnderstanding.Instance.UnderstandingCustomMesh.DrawProcessedMesh = false;
            SceneManager.LoadScene(0);
            break;

        case "skip scan":
            SpatialUnderstanding.Instance.UnderstandingCustomMesh.DrawProcessedMesh = false;
            SceneManager.LoadScene(2);
            break;
        }
    }