Class Inventory
Describe the products that belong to the application and purchases made by the current user.
Inherited Members
Namespace: UnityEngine.UDP
Syntax
public class Inventory
Constructors
Inventory()
Declaration
public Inventory()
Methods
GetProductDictionary()
Retrieve products as a dictionary.
Declaration
public IDictionary<string, ProductInfo> GetProductDictionary()
Returns
Type | Description |
---|---|
IDictionary<String, ProductInfo> | dictionary of products |
GetProductInfo(String)
Retrieve the product information for the given productId.
Declaration
public ProductInfo GetProductInfo(string productId)
Parameters
Type | Name | Description |
---|---|---|
String | productId | Product ID |
Returns
Type | Description |
---|---|
ProductInfo | ProductInfo |
GetProductList()
Retrieve products as a list.
Declaration
public IList<ProductInfo> GetProductList()
Returns
Type | Description |
---|---|
IList<ProductInfo> | list of products |
GetPurchaseDictionary()
Retrieve purchases as a dictionary.
Declaration
public IDictionary<string, PurchaseInfo> GetPurchaseDictionary()
Returns
Type | Description |
---|---|
IDictionary<String, PurchaseInfo> | dictionary of purchases |
GetPurchaseInfo(String)
Retrieve PurchaseInfo for the given productId.
Declaration
public PurchaseInfo GetPurchaseInfo(string productId)
Parameters
Type | Name | Description |
---|---|---|
String | productId | Product ID |
Returns
Type | Description |
---|---|
PurchaseInfo | PurchaseInfo |
GetPurchaseList()
Retrieve purchases as a list.
Declaration
public List<PurchaseInfo> GetPurchaseList()
Returns
Type | Description |
---|---|
List<PurchaseInfo> | list of purchases |
HasProduct(String)
Check if a specific product exists.
Declaration
public bool HasProduct(string productId)
Parameters
Type | Name | Description |
---|---|---|
String | productId | Product ID |
Returns
Type | Description |
---|---|
Boolean | if product exists |
HasPurchase(String)
Check if any unconsumed purchase exists for given productId.
Declaration
public bool HasPurchase(string productId)
Parameters
Type | Name | Description |
---|---|---|
String | productId | Product ID |
Returns
Type | Description |
---|---|
Boolean | if purchase exists |