コード例 #1
0
    void Update()
    {
        // check if ready for dialogue
        //playerContent.text = exampleStreaming.TextOutput();
        if (recording)
        {
            //playerContent.text = playerContent.text + "\n" + exampleStreaming.TextOutput();
            playerContent.text = exampleStreaming.TextOutput();
        }



        if (inside == true && !ready)
        {
            dialogBox.SetActive(true);
            dialogue_content.text = "Would you like to talk to " + topic + "? \n"
                                    + "(Press Space or Enter to talk)";

            NPCContent.text = GetDialogue(topic);
        }
        if (inside == true && (Input.GetKeyDown(KeyCode.Space)) && !ready)
        {
            // open dialogbox
            //dialogBox.SetActive(true);
            playerBox.SetActive(true);
            NPCBox.SetActive(true);
            dialogBox.SetActive(false);
            playerContent.text = "";
            ready = true;

            // get dialogue data
        }
        else if (ready)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                ready = false;
                playerContent.text = "";
                playerBox.SetActive(false);
                NPCBox.SetActive(false);
            }
            TS();
        }


        //dialogue_content.text = "getting dialogue from AI for topic: " + topic;
        //dialogue_content.text = exampleStreaming.TextOutput();


        //dialogue_content.text = exampleStreaming.TextOutput();
    }
コード例 #2
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.K))
        {
            isRoundFinish = true;
        }
        if (Input.GetKeyDown(KeyCode.U))
        {
            scoreTotal += 10;
        }
        // check if ready for dialogue
        if (recording)
        {
            playerContent.text = exampleStreaming.TextOutput();
        }

        if (isRoundFinish && Input.GetKeyDown(KeyCode.Return))
        {
            if (isWin && SceneManager.GetActiveScene().name == "T1")
            {
                SceneManager.LoadScene("startMenu");
            }
            else
            {
                SceneManager.LoadScene(SceneManager.GetActiveScene().name);
            }
        }

        if (inside == true && !ready)
        {
            dialogBox.SetActive(true);
            dialogue_content.text = "Would you like to talk to " + topic + "? \n"
                                    + "(Press Space to talk)";
        }
        if (inside == true && (Input.GetKeyDown(KeyCode.Space)) && !ready)
        {
            NPCContent.text = GetDialogue(topic);
            playerBox.SetActive(true);
            NPCBox.SetActive(true);
            dialogBox.SetActive(false);
            playerContent.text      = "";
            inputRelevanceText.text = "";
            GrammarMessage.text     = "";
            ready = true;
        }
        else if (ready)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                ready = false;
                playerContent.text      = "";
                inputRelevanceText.text = "Input Relevance: ";
                playerBox.SetActive(false);
                NPCBox.SetActive(false);
                if (recording)
                {
                    exampleStreaming.StopRec();
                    recording = false;
                    recordIcon.SetActive(false);
                }
            }
            TS();
        }
        if (Input.GetKeyDown(KeyCode.Tab))
        {
            if (!isOpenWordList)
            {
                WordBox.SetActive(true);
                isOpenWordList = true;
            }
            else
            {
                WordBox.SetActive(false);
                isOpenWordList = false;
            }
        }
    }
コード例 #3
0
    void Update()
    {
        // check if ready for dialogue
        if (recording)
        {
            playerContent.text = exampleStreaming.TextOutput();
        }

        if (inside == true && !ready) //Enable conversation at "chat" spots
        {
            dialogBox.SetActive(true);
            dialogue_content.text = "Would you like to talk to " + topic + "? \n"
                                    + "(Press Space to talk)";
        }
        if (inside == true && (Input.GetKeyDown(KeyCode.Space)) && !ready) //Set up conversation boxes
        {
            // open dialogbox
            NPCContent.text = GetDialogue(topic);
            playerBox.SetActive(true);
            NPCBox.SetActive(true);
            dialogBox.SetActive(false);
            playerContent.text      = "";
            inputRelevanceText.text = "";
            GrammarMessage.text     = "";
            ready = true;

            // get dialogue data
        }
        else if (ready)
        {
            if (Input.GetKeyDown(KeyCode.Space)) //Close the conversation boxes once Conversation is done
            {
                ready = false;
                playerContent.text      = "";
                inputRelevanceText.text = "";
                playerBox.SetActive(false);
                NPCBox.SetActive(false);

                if (recording)
                {
                    exampleStreaming.StopRec();
                    recording = false;
                    recordIcon.SetActive(false);
                }
            }
            TS();
        }

        if (Input.GetKeyDown(KeyCode.Tab)) //Control the word list box
        {
            if (!isOpenWordList)
            {
                WordBox.SetActive(true);
                isOpenWordList = true;
            }
            else
            {
                WordBox.SetActive(false);
                isOpenWordList = false;
            }
        }
    }