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); }
public void SetShopHeroRandomCardInfo(ShopHeroRandomCardInfo shopHeroRandomCardInfo) { _shopHeroRandomCardInfo = shopHeroRandomCardInfo; nameText.text = Localization.Get(_shopHeroRandomCardInfo.ShopCardRandomData.name); descriptionText.text = Localization.Get(_shopHeroRandomCardInfo.ShopCardRandomData.description); itemIconImage.SetSprite(ResMgr.instance.Load <Sprite>(ResPath.GetShopItemIconPath(_shopHeroRandomCardInfo.ShopCardRandomData.pic))); itemIconImage.SetNativeSize(); costResourceIcon.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(_shopHeroRandomCardInfo.ShopCardRandomData.costGameResData.type))); costResourceIcon.SetNativeSize(); costResourceCountText.text = _shopHeroRandomCardInfo.ShopCardRandomData.costGameResData.count.ToString(); // freeTimesRoot.gameObject.SetActive(_shopHeroRandomCardInfo.ShopCardRandomData.freeTime > 0); // freeTimesText.text = string.Format(Localization.Get("common.value/max"), _shopHeroRandomCardInfo.RemainFreeTimes, _shopHeroRandomCardInfo.ShopCardRandomData.max); //免费抽卡取消每日次数限制,遂不在显示次数 freeTimesRoot.gameObject.SetActive(false); if (_shopHeroRandomCardInfo.RemainFreeTimes > 0) { if (_shopHeroRandomCardInfo.NextFreeBuyCountDownTime > 0) { costResourceCountText.text = _shopHeroRandomCardInfo.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); }
public void SetInfo(ShopHeroRandomCardInfo shopHeroCardInfo, HeroInfo heroInfo) { _shopHeroRandomCardInfo = shopHeroCardInfo; _heroInfo = heroInfo; ResetHero(); backText.text = Localization.Get("ui.recruit_one_hero_result_view.back"); costIconImage.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(_shopHeroRandomCardInfo.ShopCardRandomData.costGameResData.type))); costIconImage.SetNativeSize(); againText.text = string.Format(Localization.Get("ui.recruit_one_hero_result_view.again"), _shopHeroRandomCardInfo.ShopCardRandomData.costGameResData.count.ToString()); }
private void LoadShopHeroRandomCardInfoDic() { List <ShopCardRandomData> shopHeroRandomCardDataList = ShopCardRandomData.GetHeroRandomItemDataList(); int heroRandomCardDataCount = shopHeroRandomCardDataList.Count; for (int i = 0; i < heroRandomCardDataCount; i++) { ShopHeroRandomCardInfo shopHeroRandomCardInfo = new ShopHeroRandomCardInfo(shopHeroRandomCardDataList[i]); _shopHeroRandomCardInfoDic.Add(shopHeroRandomCardDataList[i].id, shopHeroRandomCardInfo); } }
private void RegenerateShopHeroRandomItems() { TransformUtil.ClearChildren(heroRandomShopItemsRoot, true); List <ShopHeroRandomCardInfo> shopHeroRandomCardInfoList = ShopProxy.instance.ShopHeroRandomCardInfoDic.GetValues(); int shopHeroRandomCardInfoCount = shopHeroRandomCardInfoList.Count; ShopHeroRandomCardInfo shopHeroRandomCardInfo = null; for (int i = 0; i < shopHeroRandomCardInfoCount; i++) { shopHeroRandomCardInfo = shopHeroRandomCardInfoList[i]; ShopItemView shopItemView = GameObject.Instantiate <ShopItemView>(shopItemViewPrefab); shopItemView.SetShopHeroRandomCardInfo(shopHeroRandomCardInfo); shopItemView.name = shopHeroRandomCardInfo.ShopCardRandomData.id.ToString(); shopItemView.transform.SetParent(heroRandomShopItemsRoot, false); shopItemView.gameObject.SetActive(true); } }
public void SetNewHeroInfoList(ShopHeroRandomCardInfo shopHeroRandomCardInfo, List <HeroInfo> newHeroInfoList, HeroInfo giftHeroInfo) { int i; if (_recruitHeroItems == null) { int len = recruitHeroItemsRoot.Length; _recruitHeroItems = new RecuitHeroItem[len]; Transform itemRoot; RecuitHeroItem item; recuitItemPrefab.gameObject.SetActive(true); //normal for (i = 0; i < len; i++) { itemRoot = recruitHeroItemsRoot[i]; item = Instantiate <RecuitHeroItem>(recuitItemPrefab); item.transform.SetParent(itemRoot, false); item.transform.localPosition = Vector3.zero; _recruitHeroItems[i] = item; } //gift item = Instantiate <RecuitHeroItem>(recuitItemPrefab); item.transform.SetParent(giftRecruitHeroItemRoot, false); item.transform.localPosition = Vector3.zero; _giftRecruitHeroItem = item; recuitItemPrefab.gameObject.SetActive(false); } //reset Reset(); _shopHeroRandomCardInfo = shopHeroRandomCardInfo; for (i = 0; i < 10; i++) { HeroInfo heroInfo = newHeroInfoList[i]; _recruitHeroItems[i].SetHeroInfo(heroInfo); _recruitHeroItems[i].TurnOverAfter(i * turnOverInterval); } _giftRecruitHeroItem.SetHeroInfo(giftHeroInfo); _giftRecruitHeroItem.TurnOverAfter(i * turnOverInterval); backText.text = Localization.Get("ui.recruit_result_view.back"); costIconImage.SetSprite(ResMgr.instance.Load <Sprite>(UIUtil.GetBaseResIconPath(_shopHeroRandomCardInfo.ShopCardRandomData.costGameResData.type))); againText.text = string.Format(Localization.Get("ui.recruit_result_view.again"), _shopHeroRandomCardInfo.ShopCardRandomData.costGameResData.count);; }
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 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); }