示例#1
0
    private void OnChat(object[] objs)
    {
        int       position = (int)objs[0];
        int       idx      = Game.MJMgr.GetIndexByPosition(position);
        PlayerSub player   = players[idx];

        int type = (int)objs[1];

        switch (type)
        {
        case 0:
            int index = (int)objs[2];
            player.ShowMood(index);
            break;

        case 1:
            int        id     = (int)objs[2];
            ConfigWord config = ConfigWord.GetByKey(id);
            if (null != config)
            {
                player.ShowWord(config.TextContent);
                Game.SoundManager.PlayVoice(position, config.Talk);
            }
            break;

        case 2:
            string str = (string)objs[2];
            player.ShowWord(str);
            break;

        case 3:
            byte[] data = (byte[])objs[2];
            player.ShowVoice(data, detail.AudioSource_MicrophoneInput);
            break;
        }
    }