Exemplo n.º 1
0
    private void OnPhraserecognized(PhraseRecognizedEventArgs args)
    {
        string sceneName = SceneManager.GetActiveScene().name;
        float  newX      = Random.Range(-3, 3);
        float  newZ      = Random.Range(-3, 3);

        if (args.text == m_keywords[0])
        {
            SceneManager.LoadScene(sceneName, LoadSceneMode.Single);
            m_recognizer.Stop();
            m_recognizer.Dispose();
            Start();
        }

        if (args.text == m_keywords2[0])
        {
            mower.GetMowerMovementData();
            mower.GetMowerRotationData();
            mower.StartCoroutine(mower.MowerMove(mower.mowerMovement));
            ghost.GetGhostMovementData();
            ghost.GetGhostRotationData();
            ghost.StartCoroutine(ghost.GhostMove(ghost.ghostMovement));
            m_recognizer2.Stop();
            m_recognizer2.Dispose();
            Start();
        }

        if (args.text == m_keywords3[0])
        {
            mower.startsimulation();
            m_recognizer2.Stop();
            m_recognizer2.Dispose();
            Start();
        }
    }