Пример #1
0
        public void setItem <T>(T definition, int itemDefaultCost, MarketPlaceUtils.IsItemInSaleDelegate <T> isItemInSale)
        {
            int itemCost = MarketPlaceUtils.GetItemCost(definition, itemDefaultCost, isItemInSale);

            if (itemCost != itemDefaultCost)
            {
                showItemOnSale(itemCost, itemDefaultCost);
            }
            else
            {
                showItemDefaultPrice(itemDefaultCost);
            }
        }
        private int getItemCost(PropDefinition definition)
        {
            int itemCost = MarketPlaceUtils.GetItemCost(definition, definition.Cost, isItemInSale);

            if (itemCost != definition.Cost)
            {
                SalePanel.SetActive(value: true);
                SaleText.text = string.Format(Service.Get <Localizer>().GetTokenTranslation("GoGuide.ShopSale.Discount"), MarketPlaceUtils.GetItemDiscountPercentage(definition, isItemInSale));
            }
            else
            {
                SalePanel.SetActive(value: false);
            }
            return(itemCost);
        }