Ejemplo n.º 1
0
        public bool LOBBY2CLIENT_DRAW_CARD_GOODS_RESP(Observers.Interfaces.INotification note)
        {
            DrawCardGoodsResp         drawCardGoodsResp      = note.Body as DrawCardGoodsResp;
            List <DrawCardGoodsProto> drawCardGoodsProtoList = drawCardGoodsResp.goods;
            int drawCardGoodsProtoCount = drawCardGoodsProtoList.Count;

            for (int i = 0; i < drawCardGoodsProtoCount; i++)
            {
                DrawCardGoodsProto          drawCardGoodsProto          = drawCardGoodsProtoList[i];
                ShopHeroRandomCardInfo      shopHeroRandomCardInfo      = null;
                ShopEquipmentRandomCardInfo shopEquipmentRandomCardInfo = null;
                ShopProxy.instance.ShopHeroRandomCardInfoDic.TryGetValue(drawCardGoodsProto.goodsNo, out shopHeroRandomCardInfo);
                ShopProxy.instance.ShopEquipmentRandomCardInfoDic.TryGetValue(drawCardGoodsProto.goodsNo, out shopEquipmentRandomCardInfo);
                if (shopHeroRandomCardInfo != null)
                {
                    shopHeroRandomCardInfo.setFreeInfo(drawCardGoodsProto.remainFreeTimes, drawCardGoodsProto.freeDrawCoolingOverTime);
                }
                else if (shopEquipmentRandomCardInfo != null)
                {
                    shopEquipmentRandomCardInfo.setFreeInfo(drawCardGoodsProto.remainFreeTimes, drawCardGoodsProto.freeDrawCoolingOverTime);
                }
            }
            ShopProxy.instance.OnShopHeroRandomCardInfoListUpdate();
            ShopProxy.instance.OnShopEquipmentRandomCardInfoListUpdate();
            return(true);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        private void LoadShopEquipmentRandomCardInfoDic()
        {
            List <ShopCardRandomData> shopEquipmentRandomCardDataList = ShopCardRandomData.GetEquipmentRandomDataList();
            int equipmentRandomCardDataCount = shopEquipmentRandomCardDataList.Count;

            for (int i = 0; i < equipmentRandomCardDataCount; i++)
            {
                ShopEquipmentRandomCardInfo shopEquipmentRandomCardInfo = new ShopEquipmentRandomCardInfo(shopEquipmentRandomCardDataList[i]);
                _shopEquipmentRandomCardInfoDic.Add(shopEquipmentRandomCardDataList[i].id, shopEquipmentRandomCardInfo);
            }
        }
        public void SetNewEquipmentInfo(ShopEquipmentRandomCardInfo shopEquipmentCardInfo, EquipmentInfo equipmentInfo)
        {
            _shopEquipmentRandomCardInfo = shopEquipmentCardInfo;
            drawEquipmentItem.SetEquipmentInfo(equipmentInfo);
            drawEquipmentItem.TurnOverAfter(0.2f);

            backText.text = Localization.Get("ui.draw_equipment_result_view.back");
            costIconImage.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(_shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData.type)));
            costIconImage.SetNativeSize();
            againText.text = string.Format(Localization.Get("ui.draw_equipment_result_view.again"), _shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData.count);
        }
Ejemplo n.º 5
0
        public bool LOBBY2CLIENT_PURCHASE_DRAW_CARD_GOODS_RESP(Observers.Interfaces.INotification note)
        {
            PurchaseDrawCardGoodsResp purchaseDrawCardGoodsResp = note.Body as PurchaseDrawCardGoodsResp;
            int cardRandomID = purchaseDrawCardGoodsResp.goodsNo;
            ShopHeroRandomCardInfo      shopHeroRandomCardInfo      = null;
            ShopEquipmentRandomCardInfo shopEquipmentRandomCardInfo = null;

            ShopProxy.instance.ShopHeroRandomCardInfoDic.TryGetValue(cardRandomID, out shopHeroRandomCardInfo);
            ShopProxy.instance.ShopEquipmentRandomCardInfoDic.TryGetValue(cardRandomID, out shopEquipmentRandomCardInfo);
            if (shopHeroRandomCardInfo != null)
            {
                if (shopHeroRandomCardInfo.ShopCardRandomData.buyType == 1)
                {
                    HeroInfo rewardHeroInfo = new HeroInfo(purchaseDrawCardGoodsResp.commonGoods[0]);
                    Logic.UI.Shop.View.RecruitOneHeroResultView recruitOneHeroResultView = UIMgr.instance.Open <Logic.UI.Shop.View.RecruitOneHeroResultView>(Logic.UI.Shop.View.RecruitOneHeroResultView.PREFAB_PATH);
                    recruitOneHeroResultView.SetInfo(shopHeroRandomCardInfo, rewardHeroInfo);
                }
                else if (shopHeroRandomCardInfo.ShopCardRandomData.buyType == 2)
                {
                    List <HeroInfo> rewardCommonHeroList = new List <HeroInfo>();
                    int             commonGoodsCount     = purchaseDrawCardGoodsResp.commonGoods.Count;
                    for (int i = 0; i < commonGoodsCount; i++)
                    {
                        HeroInfo heroInfo = new HeroInfo(purchaseDrawCardGoodsResp.commonGoods[i]);
                        rewardCommonHeroList.Add(heroInfo);
                    }
                    HeroInfo giftHeroInfo = new HeroInfo(purchaseDrawCardGoodsResp.specialGoods);
                    Logic.UI.Shop.View.RecruitResultView recruitResultView = UIMgr.instance.Open <Logic.UI.Shop.View.RecruitResultView>(Logic.UI.Shop.View.RecruitResultView.PREFAB_PATH);
                    recruitResultView.SetNewHeroInfoList(shopHeroRandomCardInfo, rewardCommonHeroList, giftHeroInfo);
                }
            }
            else if (shopEquipmentRandomCardInfo != null)
            {
                Logic.UI.Shop.View.DrawEquipmentResultView drawEquipmentResultView = UIMgr.instance.Open <Logic.UI.Shop.View.DrawEquipmentResultView>(Logic.UI.Shop.View.DrawEquipmentResultView.PREFAB_PATH);
//				EquipmentInfo equipmentInfo = new EquipmentInfo(purchaseDrawCardGoodsResp.commonGoods[0]);
//				drawEquipmentResultView.SetNewEquipmentInfo(shopEquipmentRandomCardInfo, equipmentInfo);

                ItemInfo itemInfo = new ItemInfo(purchaseDrawCardGoodsResp.commonGoods[0]);
                drawEquipmentResultView.SetNewItemInfo(shopEquipmentRandomCardInfo, itemInfo);
            }
            return(true);
        }
        public void SetNewItemInfo(ShopEquipmentRandomCardInfo shopEquipmentRandomCardInfo, ItemInfo itemInfo)
        {
            _shopEquipmentRandomCardInfo = shopEquipmentRandomCardInfo;
            drawItemIcon.SetItemInfo(itemInfo);
            drawItemIcon.ShowCount();

            LeanTween.cancel(drawItemIcon.gameObject);
            LeanTween.cancel(cardBackImage.gameObject);

            drawItemIcon.transform.localScale  = new Vector3(0, 1, 1);
            cardBackImage.transform.localScale = Vector3.one;

            LTDescr ltDescr = LeanTween.scaleX(cardBackImage.gameObject, 0, 0.2f);

            ltDescr.setOnComplete(OnCardBackTurnOverComplete);

            backText.text = Localization.Get("ui.draw_equipment_result_view.back");
            costIconImage.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(_shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData.type)));
            costIconImage.SetNativeSize();
            againText.text = string.Format(Localization.Get("ui.draw_equipment_result_view.again"), _shopEquipmentRandomCardInfo.ShopCardRandomData.costGameResData.count);
        }
Ejemplo n.º 7
0
        public bool LOBBY2CLIENT_DRAW_CARD_GOODS_UPDATE_RESP(Observers.Interfaces.INotification note)
        {
            DrawCardGoodsUpdateResp drawCardGoodsUpdateResp = note.Body as DrawCardGoodsUpdateResp;
            DrawCardGoodsProto      drawCardGoodsProto      = drawCardGoodsUpdateResp.updateGoods;

            if (drawCardGoodsProto != null)
            {
                ShopHeroRandomCardInfo      shopHeroRandomCardInfo      = null;
                ShopEquipmentRandomCardInfo shopEquipmentRandomCardInfo = null;
                ShopProxy.instance.ShopHeroRandomCardInfoDic.TryGetValue(drawCardGoodsProto.goodsNo, out shopHeroRandomCardInfo);
                ShopProxy.instance.ShopEquipmentRandomCardInfoDic.TryGetValue(drawCardGoodsProto.goodsNo, out shopEquipmentRandomCardInfo);
                if (shopHeroRandomCardInfo != null)
                {
                    shopHeroRandomCardInfo.setFreeInfo(drawCardGoodsProto.remainFreeTimes, drawCardGoodsProto.freeDrawCoolingOverTime);
                }
                else if (shopEquipmentRandomCardInfo != null)
                {
                    shopEquipmentRandomCardInfo.setFreeInfo(drawCardGoodsProto.remainFreeTimes, drawCardGoodsProto.freeDrawCoolingOverTime);
                }
                ShopProxy.instance.OnShopHeroRandomCardInfoListUpdate();
                ShopProxy.instance.OnShopEquipmentRandomCardInfoListUpdate();
            }
            return(true);
        }