/// <summary> /// 显示勋章类型 个数 /// </summary> private void ShowMedalTypeImg() { StringBuilder _str = new StringBuilder(); _str.Append("/"); _str.Append(m_MedalData.getNeedNum()); m_MaxCountTXt.text = _str.ToString(); if (m_MedalData.getExchangeType() == 1) { m_MedalImg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + "huangjin"); m_CurCountTxt.text = (Mathf.Min(m_MedalData.getNeedNum(), ObjectSelf.GetInstance().HuangjinXZ)).ToString(); } else if (m_MedalData.getExchangeType() == 2) { m_MedalImg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + "baiyin"); m_CurCountTxt.text = (Mathf.Min(m_MedalData.getNeedNum(), ObjectSelf.GetInstance().BaiJinXZ)).ToString(); } else if (m_MedalData.getExchangeType() == 3) { m_MedalImg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + "qingtong"); m_CurCountTxt.text = (Mathf.Min(m_MedalData.getNeedNum(), ObjectSelf.GetInstance().QingTongXZ)).ToString(); } else if (m_MedalData.getExchangeType() == 4) { m_MedalImg.sprite = UIResourceMgr.LoadSprite(common.defaultPath + "chitie"); m_CurCountTxt.text = (Mathf.Min(m_MedalData.getNeedNum(), ObjectSelf.GetInstance().ChiTieXZ)).ToString(); } }
/// <summary> /// 显示新的勋章奖励New图标 /// </summary> public static bool CheckNewMedalReard() { Dictionary <int, IExcelBean> _medalXmlData = DataTemplate.GetInstance().m_MedalexchangeTable.getData(); foreach (var item in _medalXmlData) { MedalexchangeTemplate _medalData = item.Value as MedalexchangeTemplate; if (ObjectSelf.GetInstance().GetHandBookBoxList().Contains(_medalData.getId()) == false) { if (_medalData.getExchangeType() == 1 && ObjectSelf.GetInstance().HuangjinXZ >= _medalData.getNeedNum()) { return(true); } else if (_medalData.getExchangeType() == 2 && ObjectSelf.GetInstance().BaiJinXZ >= _medalData.getNeedNum()) { return(true); } else if (_medalData.getExchangeType() == 3 && ObjectSelf.GetInstance().QingTongXZ >= _medalData.getNeedNum()) { return(true); } else if (_medalData.getExchangeType() == 4 && ObjectSelf.GetInstance().ChiTieXZ >= _medalData.getNeedNum()) { return(true); } } } return(false); }
/// <summary> /// 是否显示勋章达成奖励跳转提示 /// </summary> /// <returns>是 or 否</returns> private bool ShowMedalReardGotoObj() { Dictionary <int, IExcelBean> _medalXmlData = DataTemplate.GetInstance().m_MedalexchangeTable.getData(); foreach (var item in _medalXmlData) { MedalexchangeTemplate _medalData = item.Value as MedalexchangeTemplate; if (ObjectSelf.GetInstance().GetHandBookBoxList().Contains(_medalData.getId()) == false) { if (_medalData.getExchangeType() == 1 && ObjectSelf.GetInstance().HuangjinXZ >= _medalData.getNeedNum()) { //UI_HomeControler.Inst.AddUI(UI_MedardGotoObj.UI_ResPath); return(true); } else if (_medalData.getExchangeType() == 2 && ObjectSelf.GetInstance().BaiJinXZ >= _medalData.getNeedNum()) { return(true); } else if (_medalData.getExchangeType() == 3 && ObjectSelf.GetInstance().QingTongXZ >= _medalData.getNeedNum()) { return(true); } else if (_medalData.getExchangeType() == 4 && ObjectSelf.GetInstance().ChiTieXZ >= _medalData.getNeedNum()) { return(true); } } } return(false); }
/// <summary> /// 解析勋章奖励Xml数据 /// </summary> private void InitPraseXmlData() { Dictionary <int, IExcelBean> _medalXmlData = DataTemplate.GetInstance().m_MedalexchangeTable.getData(); foreach (var item in _medalXmlData) { MedalexchangeTemplate _medalData = item.Value as MedalexchangeTemplate; if (_medalData.getExchangeType() == 1) { m_GoldList.Add(_medalData); } else if (_medalData.getExchangeType() == 2) { m_SilverList.Add(_medalData); } else if (_medalData.getExchangeType() == 3) { m_BronzeList.Add(_medalData); } else if (_medalData.getExchangeType() == 4) { m_PigIronList.Add(_medalData); } } }
private bool[] CheckNewMedalReard() { for (int i = 0; i < m_TipsResultArray.Length; i++) { m_TipsResultArray[i] = false; } Dictionary <int, IExcelBean> _medalXmlData = DataTemplate.GetInstance().m_MedalexchangeTable.getData(); foreach (var item in _medalXmlData) { MedalexchangeTemplate _medalData = item.Value as MedalexchangeTemplate; var list = ObjectSelf.GetInstance().GetHandBookBoxList(); if (!ObjectSelf.GetInstance().GetHandBookBoxList().Contains(_medalData.getId())) { int _exchangeType = _medalData.getExchangeType(); if (m_TipsResultArray[_exchangeType - 1]) { continue; } switch (_exchangeType) { case 1: m_TipsResultArray[0] = ObjectSelf.GetInstance().HuangjinXZ >= _medalData.getNeedNum(); break; case 2: m_TipsResultArray[1] = ObjectSelf.GetInstance().BaiJinXZ >= _medalData.getNeedNum(); break; case 3: m_TipsResultArray[2] = ObjectSelf.GetInstance().QingTongXZ >= _medalData.getNeedNum(); break; case 4: m_TipsResultArray[3] = ObjectSelf.GetInstance().ChiTieXZ >= _medalData.getNeedNum(); break; default: break; } if (m_TipsResultArray[0] & m_TipsResultArray[1] & m_TipsResultArray[2] & m_TipsResultArray[3]) { break; } } } return(m_TipsResultArray); }