// 成功买到十个 public void SuccessBuyTen(LinkedList <LotteryItemget> itemlist) { string str = ""; foreach (var item in itemlist) { if (item.id >= 100001 && item.id <= 100010) { RuintreasureTemplate temp = (RuintreasureTemplate)DataTemplate.GetInstance().m_RuintreasureTable.getTableData(item.id); str += GameUtils.getString(temp.getParameter2()); } } string tips = string.Format(GameUtils.getString("treasure_tip1"), DataTemplate.GetInstance().m_GameConfig.getTreasure_ten_reward().ToString()); RichText text = RichText.GetRichText(tips); InterfaceControler.GetInst().AddMsgBox(text.transform, selfTransform.transform.parent); UpdateCenterItem(); UpdateRightItem(); // TODO... //foreach (var item in itemlist) //{ // string str = string.Format(GameUtils.getString("treasure_tip1"), item.num); // InterfaceControler.GetInst().AddMsgBox(str, selfTransform.transform.parent); // UpdateCenterItem(); // UpdateRightItem(); //} }
// 成功刷新 public void SuccessRefresh(LinkedList <LotteryItemget> itemlist) { string str = string.Format(GameUtils.getString("treasure_tip1"), DataTemplate.GetInstance().m_GameConfig.getTreasure_refresh_reward().ToString()); RichText text = RichText.GetRichText(str); InterfaceControler.GetInst().AddMsgBox(text.transform, selfTransform.transform.parent); InitTipsInfo(); UpdateCenterItem(); UpdateRightItem(); }
// 单次抽奖 public void SetSingGainHero() { SkillItem_publicBtn.gameObject.SetActive(false); SkillItem_passivityBtn.gameObject.SetActive(false); SkillItem_PVPBtn.gameObject.SetActive(false); m_LeftBottom.SetActive(false); m_SingHero.SetActive(true); string number = string.Format(GameUtils.getString("recruit_bubble1"), 1); RichText richText = RichText.GetRichText(number); InterfaceControler.GetInst().AddMsgBox(richText.transform, selfTransform.transform.parent); }
// 熔炼成功,重新加载界面 public void SmeltSuccess() { // 加载提示信息 int money = (int)(ObjectSelf.GetInstance().Money - _curMoney); int runeMonty = ObjectSelf.GetInstance().RuneMoney - _curRuneMoney; if (money <= 0) { string str = GameUtils.getString("runemelt_bubble3"); string text = string.Format(str, _gainExp); RichText rich = RichText.GetRichText(text); InterfaceControler.GetInst().AddMsgBox(rich.transform); } else { string str = GameUtils.getString("runemelt_bubble2"); string text = string.Format(str, _gainExp, money); RichText rich = RichText.GetRichText(text); InterfaceControler.GetInst().AddMsgBox(rich.transform); } _curRuneMoney = ObjectSelf.GetInstance().RuneMoney; _curMoney = (int)ObjectSelf.GetInstance().Money; // 更新显示数据 _gainExp = 0; _gainGold = 0; UpdateShow(0); _curRuneMoney = ObjectSelf.GetInstance().RuneMoney; _curExpText.text = ObjectSelf.GetInstance().RuneMoney.ToString(); //_goldText.text = ObjectSelf.GetInstance().Money.ToString(); _curMoney = (int)ObjectSelf.GetInstance().Money; if (_curRuneList.Count <= 0) { ClearSelectItem(); _emptyRune.SetActive(true); _runeGameObject.SetActive(false); _gainTips.SetActive(false); } else { UpdateRuneType(UI_RuneExp.inst._runeTypeIndex); } }
/// <summary> /// /// </summary> /// <param name="type"></param> public void ShowHeroData(LinkedList <int> herolist) { m_CardList.Clear(); foreach (var item in herolist) { m_CardList.Add(GetObjectCard(item)); } m_HeroLayout.cellCount = m_CardList.Count; m_HeroLayout.updateCellEvent = UpdateHeroItem; m_HeroLayout.Reload(); string number = string.Format(GameUtils.getString("recruit_bubble1"), 10); RichText richText = RichText.GetRichText(number); InterfaceControler.GetInst().AddMsgBox(richText.transform, selfTransform.transform.parent); }
//添加提示框 /// <summary> /// 通用冒泡提示框 ,建议使用此接口。 /// 不要再使用自定义的tranform位置 统一显示位置 /// </summary> /// <param name="text"></param> /// <param name="par"></param> /// <param name="MaxCount"></param> public void AddMsgBox(string text, Transform par = null, int MaxCount = 1) { if (MsgBoxList == null) { MsgBoxList = new List <MessageItem>(); } //如果是图文混排 if (text.Contains("Image")) { RichText textRich = RichText.GetRichText(text); AddMsgBox(textRich.transform, par); } else { GameObject temp = Instantiate(Resources.Load("UI/Prefabs/UI_Home/UI_MsgBox")) as GameObject; temp.transform.SetParent(par == null ? UI_HomeControler.Inst.GetTopTransform() : par, false); temp.transform.FindChild("Text").GetComponent <Text>().text = text; AddMsgBox(temp.transform, par); } }
// 熔炼成功,重新加载界面 public void SmeltSuccess() { // 泡泡提示 string str = GameUtils.getString("runemelt_bubble3"); string text = string.Format(str, _gainCount); RichText rich = RichText.GetRichText(text); InterfaceControler.GetInst().AddMsgBox(rich.transform); _curSelectCountText.text = "0"; // 提示将符文放入背包 if (_heroRune.Count > 0) { InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("heromelt_bubble1"), selfTransform.transform.parent); } // 清理数据 ClearSelectItem(); _curLithvalue.text = ObjectSelf.GetInstance().ExpFruit.ToString(); _gainCount = 0; UpdateShow(0); ReloadHero(); }