void playVoice() { VoiceMgr vmr = VoiceMgr.GetInstance(); RoomMgr rm = RoomMgr.GetInstance(); if (_playingSeat < 0 && mVoiceQueue.Count > 0) { ChatItem vm = mVoiceQueue.Dequeue(); string msg = vm.voice.msg; string file = vm.path; int si = rm.getSeatIndexByID(vm.sender); int local = rm.getLocalIndex(si); _playingSeat = local; vmr.writeVoice(file, msg); vmr.play(file); if (playing != null) { playing.SetActive(false); playing = null; } playing = vm.vobj; if (playing != null) { playing.SetActive(true); } _lastPlayTime = PUtils.getMilliSeconds() + vm.voice.time; } }