Beispiel #1
0
    void botReply()
    {
        string user_text = ChatContent.GetChild(ChatContent.childCount - 1).GetComponent <Text>().text;
        string t         = "";
        //t = user_text; //test

        List <concept_ID> sentenceConcepts = Concept.getConcepts(user_text);

        float[] d = Response.getMovement(sentenceConcepts, Aim.position.x, Aim.position.y);
        //Debug.Log ("test");
        newAimPosition = new Vector3(d[0], d[1], 0f);
        bool hasMoved = d[2] == 1f;

        t = Response.getBestResponse(sentenceConcepts, hasMoved);

        t += '\n';
        GameObject newText = (GameObject)Instantiate(BotTextPrefab, new Vector3(0, 0, 0), Quaternion.identity);

        newText.transform.SetParent(ChatContent.transform);
        newText.GetComponent <Text>().text = t;
        Scroll.value = 0;
    }