예제 #1
0
    public bool NetReciveMsg(byte[] recivebuffer, int netID)
    {
        var arg = new ByteOutArg(recivebuffer);
        var str = arg.ReadString();

        ResList.Enqueue(str);
        //UnityEngine.Debug.Log(str);
        return(true);
    }
예제 #2
0
        public bool NetReciveMsg(byte[] recivebuffer, int netID)
        {
            var arg = new ByteOutArg(recivebuffer);
            var cmd = arg.ReadInt32();

            switch ((EmCmd)cmd)
            {
            case EmCmd.Init:
                Init();
                break;

            case EmCmd.Speak:
                var speakcmd = arg.ReadInt32();
                if (speakcmd == 0)
                {
                    var str = arg.ReadString();
                    Console.WriteLine(str);
                    m_speecher.Speak(str);
                }
                else if (speakcmd == 1)
                {
                    m_speecher.Pause();
                }
                else if (speakcmd == 2)
                {
                    m_speecher.Resume();
                }
                return(true);

            case EmCmd.Recognize:
                var scmd = arg.ReadInt32();
                if (scmd == 1)
                {
                    m_recognizer.BeginRec();
                }
                if (scmd == 0)
                {
                    m_recognizer.EndRec();
                }
                return(true);

            default:
                throw new ArgumentOutOfRangeException();
            }
            return(false);
        }