Exemple #1
0
 private void windowFunc(int id)
 {
     // Question User
     GUILayout.Label(user + ": " + messBox);
     // Response bot
     GUILayout.Label("BOT: " + messBoxAnswer);
     //Skip a few lines to the box question becomes more below.
     //GUILayout.Label ("\n");
     //
     GUILayout.BeginHorizontal();
     // Where the player put the text
     ask = GUILayout.TextField(ask);
     //=================================================
     if (GUILayout.Button("Send", GUILayout.Width(75)))
     {
         messBox = ask;
         // Response Bot AIML
         var answer = bot.getOutput(ask);
         // Response BotAIml in the Chat window
         messBoxAnswer = answer;
         ask           = "";
     }
     //==================================================
     GUILayout.EndHorizontal();
 }            //close windowFunc
 void Start()
 {
     bot = new Chatbot ();
             string input = "Hello, what is your name";
             var output = bot.getOutput (input);
             Debug.Log (input);
             Debug.Log (output);
 }
    void Start()
    {
        bot = new Chatbot();
        string input  = "Hello, what is your name";
        var    output = bot.getOutput(input);

        Debug.Log(input);
        Debug.Log(output);
    }
    private void windowFunc(int id)
    {
        //=============== Start Scroll =====================
        scrollPosition = GUILayout.BeginScrollView(scrollPosition, /*GUILayout.Width (100),*/ GUILayout.Height(350));
        //--------------------
        ObjectsInsideTheScroll();
        //--------------------
        //=============== End Scroll =====================
        GUILayout.EndScrollView();
        //
        if (GUILayout.Button("Clear"))
        {
            messBox = "";
        }
        GUILayout.BeginHorizontal();
        // Where the player put the text
        ask = GUILayout.TextField(ask);
        //=================================================
        if (GUILayout.Button("Send", GUILayout.Width(75)))
        {
            messBox += user + ": " + ask + "\n" + "\n";
            //Response Bot AIML
            var answer = bot.getOutput(ask);
            //Response BotAIml in the Chat window
            messBox += "BOT: " + answer + "\n" + "\n";
            ask      = "";
        }
        //==================================================
        GUILayout.EndHorizontal();
        GUILayout.BeginHorizontal();
        GUILayout.Label("User:");
        //The player places where his name
        user = GUILayout.TextField(user);

        GUILayout.EndHorizontal();

        GUI.DragWindow(new Rect(0, 0, Screen.width, Screen.height));
    }            //close windowFunc