コード例 #1
0
    public void SendQuestionToRobot()
    {
        if (string.IsNullOrEmpty(inputField.text) == false)
        {
            // Response Bot AIML
            string response = _chatBot.getOutput(inputField.text);

            //Output the response
            VoiceOut.PlayVoiceOutput(response);
            //VoiceOut.NormalOutputTesting(response);
        }
    }
コード例 #2
0
 /// <summary>
 /// Button to send the question to the robot
 /// </summary>
 public void SendQuestionToRobot()
 {
     if (string.IsNullOrEmpty(inputField.text) == false)
     {
         // Response Bot AIML
         var answer = bot.getOutput(inputField.text);
         // Response BotAIml in the Chat window
         robotOutput.text = answer;
         //
         inputField.text = string.Empty;
     }
 }
コード例 #3
0
        public void SendMessageToBot()
        {
            var userMessage = chatBox.text;

            if (!string.IsNullOrEmpty(userMessage))
            {
                Debug.Log($"aimlBot:[USER] {userMessage}");
                AddMessage($"User: {userMessage}", MessageType.User);

                var botMessage = bot.getOutput(userMessage);

                Debug.Log($"aimlBot:[BOT] {botMessage}");
                AddMessage($"Bot: {botMessage}", MessageType.Bot);

                chatBox.Select();
                chatBox.text = "";
            }
        }