使用 Soomla 获取类别中的所有虚拟商品及其价格
Get all virtual goods in a category and their prices with Soomla
我敢打赌这很简单,但我似乎找不到获取特定类别中所有虚拟商品的方法。
还有,如何获得虚拟好价?
获取价格:
PurchasableVirtualItem purchaseableVirtualItem = StoreInfo
.GetPurchasableItemWithProductId (MyGameStore.NO_ADS_UNLOCK_ALL_PRODUCT_ID);
float unlockAllPrice = ((PurchaseWithMarket)purchaseableVirtualItem.PurchaseType)
.MarketItem
.MarketPriceAndCurrency;
你自己声明了类别,所以你已经可以访问其中的所有ID,看这个例子:
public static VirtualCategory GENERAL_CATEGORY = new VirtualCategory (
"General", new List<string> (new string[] {
NO_ADS_LIFETIME_PRODUCT_ID,
NO_ADS_UNLOCK_ALL_PRODUCT_ID,
}));
我敢打赌这很简单,但我似乎找不到获取特定类别中所有虚拟商品的方法。 还有,如何获得虚拟好价?
获取价格:
PurchasableVirtualItem purchaseableVirtualItem = StoreInfo
.GetPurchasableItemWithProductId (MyGameStore.NO_ADS_UNLOCK_ALL_PRODUCT_ID);
float unlockAllPrice = ((PurchaseWithMarket)purchaseableVirtualItem.PurchaseType)
.MarketItem
.MarketPriceAndCurrency;
你自己声明了类别,所以你已经可以访问其中的所有ID,看这个例子:
public static VirtualCategory GENERAL_CATEGORY = new VirtualCategory (
"General", new List<string> (new string[] {
NO_ADS_LIFETIME_PRODUCT_ID,
NO_ADS_UNLOCK_ALL_PRODUCT_ID,
}));