private IEnumerator CycleNoticeCoroutine(BroadCastData data, List <string> param) { int repeat = data.repeat_times; int per = data.repeat_every_time; string s = string.Empty; if (param == null || param.Count == 0) { s = Localization.Get(data.des); } else { s = string.Format(Localization.Get(data.des), param.ToArray()); } while (true) { AddSystemNotice(s); repeat--; if (repeat <= 0) { break; } yield return(new WaitForSeconds(per)); } }
public void AddSystemCycleNotice(int id, List <string> param = null) { BroadCastData data = BroadCastData.GetBroadcastDataById(id); if (data != null) { StartCoroutine(CycleNoticeCoroutine(data, param)); } }
public void AddSystemNotice(int id, List <string> param = null) { BroadCastData data = BroadCastData.GetBroadcastDataById(id); if (data == null) { return; } string log = "[AddSystemNotice]id " + id; for (int i = 0; i < param.Count; i++) { log += " ,param:" + param[i]; } Debugger.Log(log); string s = string.Empty; if (param == null || param.Count == 0) { s = Localization.Get(data.des); } else { if (data.id == 2001 && param.Count >= 2) //恭喜{0}玩家获得橙色英雄{1},从此之后实力更进一步 { int heroId = param[1].ToInt32(); HeroData heroData = HeroData.GetHeroDataByID(heroId); if (heroData != null) { s = string.Format(Localization.Get(data.des), param[0], UIUtil.FormatStringWithinQualityColor(heroData.roleQuality, Localization.Get(heroData.name))); } else { Debugger.Log("can not find herodata by id:" + heroId); } } else if (data.id == 2002 && param.Count >= 3) // { int heroId = param[1].ToInt32(); HeroData heroData = HeroData.GetHeroDataByID(heroId); if (heroData != null) { s = string.Format(Localization.Get(data.des), param[0], Localization.Get(heroData.name), param[2]); } else { Debugger.Log("can not find herodata by id:" + heroId); } } else if (data.id == 2003 && param.Count >= 2) //恭喜{0}玩家获得橙色品质装备{1},如虎添翼,战无不胜 { int equipId = param[1].ToInt32(); EquipmentData equipData = EquipmentData.GetEquipmentDataByID(equipId); if (equipData != null) { s = string.Format(Localization.Get(data.des), param[0], UIUtil.FormatStringWithinQualityColor(equipData.quality, Localization.Get(equipData.name))); } else { Debugger.Log("can not find equipdata by id:" + equipId); } } else { s = string.Format(Localization.Get(data.des), param.ToArray()); } } AddSystemNotice(s); }