少年修仙传客户端代码仓库
client_linchunjie
2018-08-27 d106f11e7f44c748f595da36e0cdfd54849649e6
System/Dungeon/TrialExchangeBehaviour.cs
@@ -9,6 +9,7 @@
{
    public class TrialExchangeBehaviour : MonoBehaviour
    {
        [SerializeField] Image m_Bottom;
        [SerializeField] ItemCell m_Item;
        [SerializeField] Text m_Description;
        [SerializeField] ItemBehaviour m_Token;
@@ -36,7 +37,7 @@
                {
                    if (error == 1)
                    {
                        var config = ConfigManager.Instance.GetTemplate<TrialExchangeConfig>(trialExchangeId);
                        var config = Config.Instance.Get<TrialExchangeConfig>(trialExchangeId);
                        if (config != null)
                        {
                            ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(config.tokenId);
@@ -46,10 +47,11 @@
            }
        }
        public void Display(int id, bool equipBetter = true)
        public void Display(int id, bool equipBetter = true, bool first = false)
        {
            m_Bottom.SetSprite(first ? "SpecialExchangeBottom" : "Title_PopupWindow");
            trialExchangeId = id;
            var config = ConfigManager.Instance.GetTemplate<TrialExchangeConfig>(id);
            var config = Config.Instance.Get<TrialExchangeConfig>(id);
            if (config == null)
            {
                trialExchangeId = 0;
@@ -57,22 +59,22 @@
            }
            m_Item.cellBtn.RemoveAllListeners();
            m_Item.gameObject.SetActive(true);
            ItemCellModel cellModel = new ItemCellModel(config.exchangeItemID, true, (ulong)config.exchangeItemCount, config.exchangeItemIsBind);
            ItemCellModel cellModel = new ItemCellModel(model.GetExchangeItemByJob(config), true, (ulong)config.exchangeItemCount, config.exchangeItemIsBind);
            m_Item.Init(cellModel);
            m_Item.cellBtn.AddListener(() =>
            {
                ItemAttrData itemAttrData = new ItemAttrData(config.exchangeItemID, true, (ulong)config.exchangeItemCount, -1, config.exchangeItemIsBind, true);
                ItemAttrData itemAttrData = new ItemAttrData(model.GetExchangeItemByJob(config), true, (ulong)config.exchangeItemCount, -1, config.exchangeItemIsBind, true);
                ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
            });
            m_Description.text = config.description;
            m_Token.SetItem(config.tokenId, config.tokenCount);
            var count = model.GetTrialTokenCount(config.tokenId);
            m_Token.count.color = UIHelper.GetUIColor(count >= config.tokenCount ? TextColType.Green : TextColType.NavyBrown, true);
            var equipCompare = model.EquipCompare(config.exchangeItemID);
            var equipCompare = model.EquipCompare(model.GetExchangeItemByJob(config));
            m_Up.gameObject.SetActive(equipCompare == 1);
            m_Down.gameObject.SetActive(equipCompare == -1);
            var exchangeItemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(config.exchangeItemID);
            var exchangeItemConfig = Config.Instance.Get<ItemConfig>(model.GetExchangeItemByJob(config));
            m_Redpoint.gameObject.SetActive(count >= config.tokenCount && (equipBetter || exchangeItemConfig.EquipPlace == 0));
        }
    }