Example #1
0
        void OnItemInGrid(PremiumCurrencyBundle item, GameObject obj)
        {
            PremiumBundle creditBundle = obj.GetComponent <PremiumBundle>();

            creditBundle.Amount = item.CreditAmount.ToString();
            creditBundle.Cost   = item.Cost.ToString();

            if (item.Data.Count > 0)
            {
                creditBundle.ProductID = item.Data[0].Value;
            }

            //if (item.CreditPlatformIDs.ContainsKey("IOS_Product_ID"))
            //    creditBundle.ProductID = item.CreditPlatformIDs["IOS_Product_ID"].ToString();

            creditBundle.BundleID = item.ID.ToString();

            creditBundle.PremiumCurrencyName = "";
            creditBundle.Description         = item.Description;


            if (!string.IsNullOrEmpty(item.Image))
            {
                ItemTextureCache.GetItemTexture(item.Image, delegate(Texture2D texture)
                {
                    creditBundle.SetIcon(texture);
                });
            }

            creditBundle.SetBundleName(item.Name);

            creditBundle.OnPurchaseRequest = OnPurchaseRequest;
        }
        public virtual void Init(StoreItem item, UnityUIStoreLoader unityStoreLoader)
        {
            storeItem   = item;
            storeLoader = unityStoreLoader;
            ItemTextureCache.GetItemTexture(storeItem.ItemInformation.ImageName, OnReceivedItemTexture);
            StoreItemText.text = storeItem.ItemInformation.Name;

            SetPriceDisplay();
        }
        public void Start()
        {
            holdingContainer = this.transform.GetComponentInParent <ItemContainerDisplay>();
            itemObject       = this.GetComponent <ItemDataComponent>();


            SetAmountText(itemObject.itemData.Amount.ToString());
            ItemTextureCache.GetItemTexture(itemObject.itemData.Information.ImageName, OnReceivedItemTexture);
            //SetFrameColor(ItemQuailityColorSelector.GetColorForItem(itemObject.itemData));
        }
Example #4
0
        public void SetupBundleItemDisplay(ItemBundleInfo.BundleItemInformation newBundleItem)
        {
            bundleItem = newBundleItem;

            ItemName.text   = bundleItem.Information.Name;
            itemAmount.text = "Amount: " + bundleItem.Amount;

            ItemStats.text = "";

            ItemTextureCache.GetItemTexture(bundleItem.Information.ImageName, OnReceivedItemTexture);
        }
        private static void GetWolrdCurrencyInfo(List <int> location)
        {
            if (!IsGettingWolrdCurrency)
            {
                IsGettingWolrdCurrency = true;
                ItemStoreServices.GetCurrencyInfo(worldCurrencyInfo =>
                {
                    ItemTextureCache.GetItemTexture(worldCurrencyInfo.PremiumCurrencyImage, icon =>
                    {
                        PremiumInfo = new CurrencyDetails()
                        {
                            Name = worldCurrencyInfo.PremiumCurrencyName,
                            Icon = icon
                        };
                        if (RecivedPremiumDetails != null)
                        {
                            RecivedPremiumDetails(PremiumInfo.Name, PremiumInfo.Icon);
                        }
                    });
                    ItemStoreServices.GetPremiumCurrencyBalance(premiumCurrencyResponse =>
                    {
                        PremiumAmount = premiumCurrencyResponse.Amount;
                        if (RecivecdPremiumAmount != null)
                        {
                            RecivecdPremiumAmount(premiumCurrencyResponse.Amount);
                        }
                    });

                    ItemTextureCache.GetItemTexture(worldCurrencyInfo.StandardCurrencyImage, icon =>
                    {
                        StandardInfo = new CurrencyDetails()
                        {
                            Name = worldCurrencyInfo.StandardCurrencyName,
                            Icon = icon
                        };
                        if (RecivedStandardDetails != null)
                        {
                            RecivedStandardDetails(StandardInfo.Name, StandardInfo.Icon);
                        }
                    });
                    ItemStoreServices.GetStandardCurrencyBalance(new StandardCurrencyBalanceRequest(StandardCurrencyLoaction), standardCurrencybalance =>
                    {
                        StandardAmount = standardCurrencybalance.Total;
                        if (RecivecdStandardAmount != null)
                        {
                            RecivecdStandardAmount(standardCurrencybalance.Total);
                        }
                    });
                });
            }
        }
Example #6
0
        public void SetupUnityUIItemBundle(ItemBundleInfo newItemBundle, UnityUIBundlePurchasing purchasing)
        {
            itemBundle       = newItemBundle;
            bundlePurchasing = purchasing;

            ItemTextureCache.GetItemTexture(itemBundle.Image, OnReceivedItemTexture);
            StoreItemText.text = itemBundle.Name;

            Button button = GetComponent <Button>();

            button.onClick.AddListener(OnClickedItemBundle);

            ChangePurchaseButtonDisplay(itemBundle.PremiumPrice, itemBundle.StandardPrice);
        }
Example #7
0
        void SetBundleItemToDisplay(int index)
        {
            ItemBundleInfo.BundleItemInformation bundleitem = itemBundle.Items[index];

            ItemName.text = bundleitem.Information.Name;

            string formated = "";

            //foreach (BundleItemDetails detail in bundleitem.bundleItemDetails)
            //{
            //    formated = string.Format("{0}{1}: {2}\n", formated, detail.BundleDetailName, detail.Value.ToString());
            //}

            ItemDetails.text = formated;

            ItemTextureCache.GetItemTexture(bundleitem.Information.ImageName, OnReceivedItemTexture);
        }