private void UpdateItemInfo() { this.icon.SetSprite(this.itemConfig.icon + string.Empty); this.titleTM.text = this.itemConfig.title; this.titleTM.Commit(); if (this.itemConfig.priceType == ShopPriceType.Money) { this.priceTM.text = "¥" + this.itemConfig.price + string.Empty; } else { this.priceTM.text = this.itemConfig.price + string.Empty; } this.priceTM.Commit(); this.canBuyNum = GameData.instance.GetShopItemCanBuyStatus(this.itemConfig.id); if (this.itemConfig.effect != ShopItemDiscountType.None) { if (((this.itemConfig.effect == ShopItemDiscountType.DoubleAmount) && (this.canBuyNum != null)) && (this.canBuyNum.hadBuyNum > 0)) { this.effectObj.SetActive(false); } else { this.effectObj.SetActive(true); this.effectSprite.SetSprite("effect" + ((int) this.itemConfig.effect)); } } if ((this.canBuyNum != null) && !this.canBuyNum.CanBuy) { if (this.buyBtn != null) { this.buyBtn.SetActive(false); } this.descTM.text = Localization.Localize("ShopBuyHaveReachLimitShort"); this.descTM.Commit(); } else { this.descTM.text = this.itemConfig.brief; this.descTM.Commit(); } if ((this.itemConfig.iosIapId == "monthlycard") && (this.endTM != null)) { if ((this.canBuyNum != null) && (this.canBuyNum.EndDaysLeft > 0)) { this.endTM.text = string.Format(Localization.Localize("ShopItemEndTime"), TimeFormatter.GetDate(this.canBuyNum.endTime)); } else { this.endTM.text = string.Empty; } this.endTM.Commit(); } }
public void SetShopItemCanBuyStatus(ShopItemCanBuyStatus[] list) { if (list == null) { this.shopItemCanBuyStatus = new Dictionary<int, ShopItemCanBuyStatus>(); } else { if (f_am_cache37 == null) { f_am_cache37 = n => n.id; } if (f_am_cache38 == null) { f_am_cache38 = n => n; } this.shopItemCanBuyStatus = list.ToDictionary<ShopItemCanBuyStatus, int, ShopItemCanBuyStatus>(f_am_cache37, f_am_cache38); } }