示例#1
0
        protected override void OnGetResponse(string res)
        {
            var response = JsonUtility.FromJson <CleverBotResponseBase>(res);

            Speecher.Speech(response.Text);
            ChatBot.Cs = response.cs;
        }
示例#2
0
    public virtual void OnGUI()
    {
        if (GUILayout.Button("Connect"))
        {
            StartCoroutine(Speecher.Connect());
        }
        if (GUILayout.Button("InitServer"))
        {
            StartCoroutine(Speecher.InitServer());
        }

        m_msg = GUILayout.TextField(m_msg);
        if (GUILayout.Button("Speak"))
        {
            Speecher.Speech(m_msg);
        }

        if (GUILayout.Button("Pause"))
        {
            StartCoroutine(Speecher.Pause());
        }

        if (GUILayout.Button("Resume"))
        {
            StartCoroutine(Speecher.Resume());
        }

        if (GUILayout.Button("Recognize Start"))
        {
            Speecher.Recognize(true);
        }
        if (GUILayout.Button("Recognize End"))
        {
            Speecher.Recognize(false);
        }
    }
示例#3
0
    public static void Speak(string str)
    {
#if UNITY_EDITOR || UNITY_STANDALONE_WIN
        Ins.Speech(str);
#endif
    }
        protected override void OnGetResponse(string res)
        {
            var response = JsonUtility.FromJson <TuLingResponseBase>(res);

            Speecher.Speech(response.text);
        }