docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Inventory

    Describe the products that belong to the application and purchases made by the current user.

    Inheritance
    object
    Inventory
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: UnityEngine.UDP
    Assembly: UDP.dll
    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
    bool

    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
    bool

    if purchase exists

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)