1

I bet this is simple, but I can't seem to find a way to get all virtual goods in a specific category. Also, how to get a virtual good price?

cahen
  • 15,807
  • 13
  • 47
  • 78
couceirof
  • 574
  • 7
  • 19

1 Answers1

1

Getting the price:

PurchasableVirtualItem purchaseableVirtualItem = StoreInfo
    .GetPurchasableItemWithProductId (MyGameStore.NO_ADS_UNLOCK_ALL_PRODUCT_ID);

float unlockAllPrice = ((PurchaseWithMarket)purchaseableVirtualItem.PurchaseType)
    .MarketItem
    .MarketPriceAndCurrency;

You declare the category yourself, so you already have access to all IDs in it, see this example:

public static VirtualCategory GENERAL_CATEGORY = new VirtualCategory (
        "General", new List<string> (new string[] {
        NO_ADS_LIFETIME_PRODUCT_ID,
        NO_ADS_UNLOCK_ALL_PRODUCT_ID,
    }));
cahen
  • 15,807
  • 13
  • 47
  • 78
  • Thanks @carlos-rodriguez! Is the MarketPriceAndCurrency available even if offline? – couceirof Aug 14 '15 at 17:35
  • when you specify your goods in the Assets class, you also specify a price. that price is for times of no connectivity. that was the initial intent. – Andrei Bazanov Aug 15 '15 at 07:58