Пример #1
0
        public void SetShopGoldItemInfo(ShopGoldItemInfo shopGoldItemInfo)
        {
            _shopGoldItemInfo    = shopGoldItemInfo;
            nameText.text        = Localization.Get(_shopGoldItemInfo.ShopLimitItemData.name);
            descriptionText.text = Localization.Get(_shopGoldItemInfo.ShopLimitItemData.description);
            itemIconImage.SetSprite(ResMgr.instance.Load <Sprite>(ResPath.GetShopItemIconPath(_shopGoldItemInfo.ShopLimitItemData.pic)));
            itemIconImage.SetNativeSize();

            freeTimesRoot.SetActive(false);
            limitTimesRoot.SetActive(false);
            freeCountDownSlider.gameObject.SetActive(false);

            costResourceIcon.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(_shopGoldItemInfo.ShopLimitItemData.costGameResData.type)));
            costResourceIcon.SetNativeSize();
            costResourceCountText.text = _shopGoldItemInfo.ShopLimitItemData.costGameResData.count.ToString();

            if (_shopGoldItemInfo.RemainPurchaseTimes > 0)
            {
                buyButton.gameObject.SetActive(true);
                soldOutButton.gameObject.SetActive(false);
            }
            else
            {
                buyButton.gameObject.SetActive(false);
                soldOutButton.gameObject.SetActive(true);
            }
        }
Пример #2
0
        public void SetShopGoodItemInfo(ShopGoodsItemInfo shopGoodsItemInfo)
        {
            _shopGoodsItemInfo = shopGoodsItemInfo;

            GameResData goodsGameResData = _shopGoodsItemInfo.ShopGoodsData.goodsGameResData;

            nameText.text        = Localization.Get(_shopGoodsItemInfo.ShopGoodsData.name);
            descriptionText.text = Localization.Get(_shopGoodsItemInfo.ShopGoodsData.description);

            string itemIconSpritePath = string.Empty;

            if (!string.IsNullOrEmpty(_shopGoodsItemInfo.ShopGoodsData.pic))
            {
                itemIconSpritePath = ResPath.GetShopItemIconPath(_shopGoodsItemInfo.ShopGoodsData.pic);
            }
            else
            {
                if (goodsGameResData.type == Logic.Enums.BaseResType.Item)
                {
                    ItemData itemData = ItemData.GetItemDataByID(goodsGameResData.id);
                    itemIconSpritePath = ResPath.GetItemIconPath(itemData.icon);
                }
                else if (goodsGameResData.type == Logic.Enums.BaseResType.Hero)
                {
                    HeroData heroData = HeroData.GetHeroDataByID(goodsGameResData.id);
                    itemIconSpritePath = ResPath.GetCharacterHeadIconPath(heroData.headIcons[heroData.starMin - 1]);
                }
            }
            itemIconImage.SetSprite(ResMgr.instance.Load <Sprite>(itemIconSpritePath));
            itemIconImage.SetNativeSize();

            costResourceIcon.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(_shopGoodsItemInfo.ShopGoodsData.costGameResData.type)));
            costResourceIcon.SetNativeSize();
            costResourceCountText.text = _shopGoodsItemInfo.ShopGoodsData.costGameResData.count.ToString();

            freeTimesRoot.SetActive(false);
            freeCountDownSlider.gameObject.SetActive(false);

            if (_shopGoodsItemInfo.ShopGoodsData.itemNum > 0)
            {
                if (_shopGoodsItemInfo.RemainPurchaseTimes > 0)
                {
                    buyButton.gameObject.SetActive(true);
                    soldOutButton.gameObject.SetActive(false);
                }
                else
                {
                    buyButton.gameObject.SetActive(false);
                    soldOutButton.gameObject.SetActive(true);
                }
                limitTimesText.text = string.Format(Localization.Get("common.value/max"), _shopGoodsItemInfo.RemainPurchaseTimes, _shopGoodsItemInfo.ShopGoodsData.itemNum);
                limitTimesRoot.SetActive(true);
            }
            else
            {
                limitTimesRoot.SetActive(false);
                buyButton.gameObject.SetActive(true);
                soldOutButton.gameObject.SetActive(false);
            }
        }
Пример #3
0
        public void SetShopEquipmentRandomCardInfo(ShopEquipmentRandomCardInfo shopEquipmentRandomCardInfo)
        {
            _shopEquipmentRandomCardInfo = shopEquipmentRandomCardInfo;
            nameText.text        = Localization.Get(_shopEquipmentRandomCardInfo.ShopCardRandomData.name);
            descriptionText.text = Localization.Get(_shopEquipmentRandomCardInfo.ShopCardRandomData.description);
            itemIconImage.SetSprite(ResMgr.instance.Load <Sprite>(ResPath.GetShopItemIconPath(_shopEquipmentRandomCardInfo.ShopCardRandomData.pic)));
            itemIconImage.SetNativeSize();
            costResourceIcon.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(_shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData.type)));
            costResourceIcon.SetNativeSize();
            costResourceCountText.text = _shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData.count.ToString();

//			freeTimesRoot.gameObject.SetActive(_shopEquipmentRandomCardInfo.ShopCardRandomData.freeTime > 0);
//			freeTimesText.text = string.Format(Localization.Get("common.value/max"), _shopEquipmentRandomCardInfo.RemainFreeTimes, _shopEquipmentRandomCardInfo.ShopCardRandomData.max);

            //免费抽卡取消每日次数限制,遂不在显示次数
            freeTimesRoot.gameObject.SetActive(false);

            if (_shopEquipmentRandomCardInfo.RemainFreeTimes > 0)
            {
                if (_shopEquipmentRandomCardInfo.NextFreeBuyCountDownTime > 0)
                {
                    costResourceCountText.text = _shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData.count.ToString();
                    freeCountDownSlider.gameObject.SetActive(true);
                    _isCountingDown = true;
                }
                else
                {
                    costResourceCountText.text = Localization.Get("ui.shop_view.free");
                    freeCountDownSlider.gameObject.SetActive(false);
                }
            }
            limitTimesRoot.SetActive(false);
            buyButton.gameObject.SetActive(true);
            soldOutButton.gameObject.SetActive(false);
        }