예제 #1
0
    void onActivityResult(string recognizedText)
    {
        AudioManager am = GameObject.FindObjectOfType <AudioManager>();

        am.audioStop();
        char[]   delimiterChars = { '~' };
        string[] result         = recognizedText.Split(delimiterChars);
        string   temp           = result[0].ToLower();
        //You can get the number of results with result.Length
        //And access a particular result with result[i] where i is an int
        //I have just assigned the best result to UI text
        int key = 0;

        for (int i = 0; i < m_keywords.Length; i++)
        {
            if (temp.Contains(m_keywords[i]))
            {
                key = i;
                //GameObject.Find("Text").GetComponent<Text>().text = temp;
                //GameObject.Find("Buttons").GetComponent<ShowProgressBarDots>().message = temp; //Added
                GameObject.Find("Buttons").SendMessage("ReceiveMessage", temp);
                am.audioPlay(key);
                print("temp " + temp);

                break;
            }
        }
        m_ObjectManager.HandleAction(key);
    }
예제 #2
0
    public void enableOnClickedFlg(int buttonId)
    {
        for (int i = 0; i < onClickedFlg.Length; i++)
        {
            onClickedFlg[i] = false;
        }
        onClickedFlg[buttonId] = true;
        //enable only onclicked bar
        int animationId = CheckClickedBar() - 1;

        if (animationId == -1)
        {
            animationTrigger.HandleAction(0);
        }
        else
        {
            animationTrigger.HandleAction(animationId); //first one button is dummy (because we removed "genes")
        }
    }