| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | using UnityEngine.UI; |
| | | |
| | | using System.Text;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace Snxxz.UI |
| | | { |
| | | |
| | |
| | | [SerializeField] Text m_UseState; |
| | | |
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } |
| | | RuneModel runeModel { get { return ModelCenter.Instance.GetModel<RuneModel>(); } } |
| | | |
| | | public void Display(int itemId) |
| | | { |
| | |
| | | var shareNumDes = tipsModel.GetShareNumItemDes(itemId); |
| | | description = description.Replace("{ShareNum}", shareNumDes); |
| | | } |
| | | if (description.Contains("{Rune}"))
|
| | | {
|
| | | var unlockRunes = runeModel.GetUnlockRunes();
|
| | | List<int> runeTypes = new List<int>();
|
| | | var sb = new StringBuilder();
|
| | | for (int i = 0; i < unlockRunes.Count; i++)
|
| | | {
|
| | | var itemConfig = ItemConfig.Get(unlockRunes[i]);
|
| | | var runeConfig = RuneConfig.Get(unlockRunes[i]);
|
| | | if (runeTypes.Contains(runeConfig.AttrType[0]))
|
| | | {
|
| | | continue;
|
| | | }
|
| | | runeTypes.Add(runeConfig.AttrType[0]);
|
| | | if (itemConfig != null)
|
| | | {
|
| | | sb.Append(itemConfig.ItemName);
|
| | | sb.Append("\n");
|
| | | }
|
| | | }
|
| | | description = description.Replace("{Rune}", sb.ToString()); |
| | | } |
| | | |
| | | m_Description.text = description; |
| | | } |