Exemplo n.º 1
0
        public void UpdateUI()
        {
            if (string.IsNullOrEmpty(Data.id))
            {
                mDMono.gameObject.CustomSetActive(false);
                return;
            }
            else
            {
                mDMono.gameObject.CustomSetActive(true);
            }

            //m_Have_Label.text = string.Format(HaveFormatStr,EB.Localizer.GetString("ID_LABEL_NAME_HADE"),Data.have);

            if (m_Discount_Label != null)
            {
                m_Discount_Label.text = LTChargeManager.GetDiscountText(Data.discount);
                m_Discount_Label.gameObject.CustomSetActive(Data.discount > 0 && Data.discount < 1);
            }

            int resBalance = BalanceResourceUtil.GetResValue(Data.cost_id);

            if (resBalance < Data.cost)
            {
                m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.RedColor;
            }
            else
            {
                m_Cost_Label.color = LT.Hotfix.Utility.ColorUtility.WhiteColor;
            }

            LTUIUtil.AddBlackOutLineToLabel(m_Cost_Label, Data.cost.ToString());
            m_Cost_Sprite.spriteName = BalanceResourceUtil.GetResSpriteName(Data.cost_id);

            if (m_UIResourceComponent != null)
            {
                m_UIResourceComponent.m_ResID = Data.cost_id;
            }

            m_Item.LTItemData = new LTShowItemData(Data.id, Data.num, Data.type, false);
            LTIconNameQuality itemInfo = LTItemInfoTool.GetInfo(m_Item.LTItemData.id, m_Item.LTItemData.type, m_Item.LTItemData.coloring);

            Data.item_name            = itemInfo.name;
            m_Item.Name.applyGradient = false;

            if (Data.sell_out)
            {
                m_Cost_Label.gameObject.CustomSetActive(false);
                m_Cost_Sprite.gameObject.CustomSetActive(false);
                m_SellOut_Sprite.gameObject.CustomSetActive(true);
                m_BuyBtn.enabled = false;
            }
            else
            {
                m_Cost_Label.gameObject.CustomSetActive(true);
                m_Cost_Sprite.gameObject.CustomSetActive(true);
                m_SellOut_Sprite.gameObject.CustomSetActive(false);
                m_BuyBtn.enabled = true;
            }
        }