public void sendMessageToPlayer(string[] message, string code) { GuangBoMessage gm = new GuangBoMessage(); gm.Massage = message; gm.Code = code; listener.insert(this, gm); }
public void showGuangBoMessage() { if (duiHuaUImanager.isDuiHuaEnd()) { if (quere.Count > 0) { // quere.g Debug.Log("guangbo quere.Count " + quere.Count); Character key = keyList[0]; Debug.Log("key is " + key.getName()); if (quere[key].Count > 0) { GuangBoMessage ms = quere[key].Dequeue(); Debug.Log(key.getName() + " guangbo msg " + ms.Massage[0]); duiHuaUImanager.setDuiHuaEndFalse(); StartCoroutine(showMessageToPlay(key, ms.Massage, random.Next(1, 2))); //showMessageToPlay(key, ms.Massage); // Debug.Log("guangbo quere[key].Count " + quere[key].Count); if (guangBoController.getEventGuangBoMap().ContainsKey(ms.Code)) { needShowConfirm = true; this.eventGuangBoCode = ms.Code; Debug.Log(duiHuaUImanager.isDuiHuaEnd()); // confirmUI.showConfirm(roundController.getPlayerChara().getLiHuiURL(), "我是不是要赶过去看一下?"); } keyList.Remove(key); quere.Remove(key); } else { Debug.Log("cant find the key in quere" + key.getName()); keyList.Remove(key); quere.Remove(key); } // quere.Clear(); } else { Debug.Log("没有广播信息了"); } } else { Debug.Log("还有其它UI没结束"); } }
public void insert(Character chara, GuangBoMessage msg) { if (quere.ContainsKey(chara)) { quere[chara].Enqueue(msg); } else { Queue <GuangBoMessage> content = new Queue <GuangBoMessage>(); content.Enqueue(msg); quere.Add(chara, content); keyList.Add(chara); } // keyList = FunctionUnity<Character>.orderList(keyList); }