Пример #1
0
 private void SetWindowContent(RentTankRole role)
 {
     MainScreenComponent.Instance.OverrideOnBack(new Action(this.CloseScreen));
     MainScreenComponent.Instance.OnPanelShow(MainScreenComponent.MainScreens.TankRent);
     if (role == RentTankRole.ANNIHILATION)
     {
         this.tankImage.sprite       = this.annihilationTank;
         this.backgroundImage.sprite = this.annihilationTankBackgroundImage;
         for (int i = 0; i < this.modules.Length; i++)
         {
             this.modules[i].sprite = this.annihilationModules[i];
         }
     }
     else if (role == RentTankRole.OFFENSIVE)
     {
         this.tankImage.sprite       = this.offensiveTank;
         this.backgroundImage.sprite = this.offensiveTankBackgroundImage;
         for (int i = 0; i < this.modules.Length; i++)
         {
             this.modules[i].sprite = this.offensiveModules[i];
         }
     }
     else if (role == RentTankRole.SUPPORT)
     {
         this.tankImage.sprite       = this.supportTank;
         this.backgroundImage.sprite = this.supportTankBackgroundImage;
         for (int i = 0; i < this.modules.Length; i++)
         {
             this.modules[i].sprite = this.supportModules[i];
         }
     }
 }
Пример #2
0
 public void InitiateScreen(GoodsPriceComponent offerGoodsPrice, DiscountComponent personalOfferDiscount, RentTankRole tankRole, ShopDialogs shopDialogs)
 {
     base.shopDialogs = shopDialogs;
     if (personalOfferDiscount.DiscountCoeff <= 0f)
     {
         this.actualPrice.text = offerGoodsPrice.Price + " " + offerGoodsPrice.Currency;
         this.SetDiscountObjects(false);
     }
     else
     {
         float num = this.RoundPrice(offerGoodsPrice.Price * (1f - personalOfferDiscount.DiscountCoeff));
         this.actualPrice.text          = num + " " + offerGoodsPrice.Currency;
         this.priceWithoutDiscount.text = offerGoodsPrice.Price.ToString(CultureInfo.InvariantCulture);
         this.discount.text             = $"-{personalOfferDiscount.DiscountCoeff * 100f}%";
         this.SetDiscountObjects(true);
     }
     this.SetWindowContent(tankRole);
 }