docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ProductDefinition

    Product definition used by Apps declaring products for sale.

    Inheritance
    object
    ProductDefinition
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Purchasing
    Assembly: Unity.Purchasing.dll
    Syntax
    public class ProductDefinition

    Constructors

    ProductDefinition(string, string, ProductType)

    Parametrized constructor

    Declaration
    public ProductDefinition(string id, string storeSpecificId, ProductType type)
    Parameters
    Type Name Description
    string id

    The product id.

    string storeSpecificId

    The product's id for a specific store.

    ProductType type

    The product type.

    ProductDefinition(string, string, ProductType, bool)

    Parametrized constructor

    Declaration
    public ProductDefinition(string id, string storeSpecificId, ProductType type, bool enabled)
    Parameters
    Type Name Description
    string id

    The product id.

    string storeSpecificId

    The product's id for a specific store.

    ProductType type

    The product type.

    bool enabled

    Whether the product is enabled for purchase or not.

    ProductDefinition(string, string, ProductType, bool, IEnumerable<PayoutDefinition>)

    Parametrized constructor

    Declaration
    public ProductDefinition(string id, string storeSpecificId, ProductType type, bool enabled, IEnumerable<PayoutDefinition> payouts)
    Parameters
    Type Name Description
    string id

    The product id.

    string storeSpecificId

    The product's id for a specific store.

    ProductType type

    The product type.

    bool enabled

    Whether the product is enabled for purchase or not.

    IEnumerable<PayoutDefinition> payouts

    The payout definitions for the product once purchased.

    ProductDefinition(string, string, ProductType, bool, PayoutDefinition)

    Parametrized constructor

    Declaration
    public ProductDefinition(string id, string storeSpecificId, ProductType type, bool enabled, PayoutDefinition payout)
    Parameters
    Type Name Description
    string id

    The product id.

    string storeSpecificId

    The product's id for a specific store.

    ProductType type

    The product type.

    bool enabled

    Whether the product is enabled for purchase or not.

    PayoutDefinition payout

    The payout definition for the product once purchased.

    ProductDefinition(string, ProductType)

    Parametrized constructor, creating a ProductDefinition where the id is the same as the store specific ID.

    Declaration
    public ProductDefinition(string id, ProductType type)
    Parameters
    Type Name Description
    string id

    The product id as well as its store-specific id.

    ProductType type

    The product type.

    ProductDefinition(string, ProductType, bool, PayoutDefinition)

    Parametrized constructor

    Declaration
    public ProductDefinition(string id, ProductType type, bool enabled, PayoutDefinition payout)
    Parameters
    Type Name Description
    string id

    The product id.

    ProductType type

    The product type.

    bool enabled

    Whether the product is enabled for purchase or not.

    PayoutDefinition payout

    The payout definition for the product once purchased.

    Properties

    enabled

    Whether or not the product is enabled for purchase.

    Declaration
    public bool enabled { get; }
    Property Value
    Type Description
    bool

    id

    Store independent ID.

    Declaration
    public string id { get; }
    Property Value
    Type Description
    string

    payout

    Gets the first attached payout. This is a shortcut for the case where only one payout is attached to the product.

    Declaration
    public PayoutDefinition payout { get; }
    Property Value
    Type Description
    PayoutDefinition

    The payout.

    payouts

    Gets all payouts attached to this product.

    Declaration
    public IEnumerable<PayoutDefinition> payouts { get; }
    Property Value
    Type Description
    IEnumerable<PayoutDefinition>

    The payouts.

    storeSpecificId

    The ID this product has on a specific store.

    Declaration
    public string storeSpecificId { get; }
    Property Value
    Type Description
    string

    type

    The type of the product.

    Declaration
    public ProductType type { get; }
    Property Value
    Type Description
    ProductType

    Methods

    Equals(object)

    Check if this product definition is equal to another.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The product definition to compare with this object.

    Returns
    Type Description
    bool

    True if the definitions are equal

    Overrides
    object.Equals(object)

    GetHashCode()

    Get the unique Hash representing the product definition.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    The hash code as integer

    Overrides
    object.GetHashCode()

    ToString()

    Returns a string representation of the product definition.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of the product definition.

    Overrides
    object.ToString()
    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)