Exemplo n.º 1
0
        public void init(XsollaPricepoint pItem, XsollaUtils pUtils)
        {
            mItem  = pItem;
            mUtils = pUtils;

            // Загружаем картинку
            if (pItem.image != "null")
            {
                mImgLoader.LoadImage(mItemImg, pItem.GetImageUrl());
            }
            else
            if (pUtils.GetProject().virtualCurrencyIconUrl != "null")
            {
                mImgLoader.LoadImage(mItemImg, pUtils.GetProject().virtualCurrencyIconUrl);
            }
            else
            {
                mItemImg.color = new Color(255, 255, 255, 0);
            }

            // Задаем короткое описание
            mShortDesc.text = pItem.GetDescription();

            // Задаем название
            mItemName.text = pUtils.GetProject().isDiscrete ? pItem.outAmount.ToString("N2") : pItem.outAmount.ToString("##.00");
            mVcCurr.text   = mUtils.GetProject().virtualCurrencyName;

            // Рекламный блок
            SetAdBlock(pItem);
            // Ценовой блок
            SetAmountBlock(pItem.sum, pItem.sumWithoutDiscount, pItem.currency);
        }
Exemplo n.º 2
0
        public override GameObject GetView(int position)
        {
            GameObject          shopItemInstance = Instantiate(shopItemPrefab) as GameObject;
            XsollaPricepoint    pricepoint       = GetItem(position);
            ShopItemViewAdapter itemAdapter      = shopItemInstance.GetComponent <ShopItemViewAdapter>();

            itemAdapter.SetImage(pricepoint.GetImageUrl());
            itemAdapter.SetName(pricepoint.GetOutString());
            itemAdapter.SetDesc(_virtualCurrencyName);
            itemAdapter.SetBuyText(_buyBtnText);
            itemAdapter.SetSpecial(pricepoint.GetDescription());
            itemAdapter.SetPrice(pricepoint.GetPriceString());
            itemAdapter.SetLabel(pricepoint.GetAdvertisementType(), pricepoint.GetLabel());
            itemAdapter.SetOnClickListener(() => OnClickBuy(pricepoint.outAmount));
            return(shopItemInstance);
        }