Class ProductDefinition
Product definition used by Apps declaring products for sale.
Namespace: UnityEngine.Purchasing
Syntax
public class ProductDefinition : object
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, Boolean)
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. |
Boolean | enabled | Whether the product is enabled for purchase or not. |
ProductDefinition(String, String, ProductType, Boolean, 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. |
Boolean | 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, Boolean, 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. |
Boolean | 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. |
Properties
enabled
Whether or not the product is enabled for purchase.
Declaration
public bool enabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
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 |
---|---|
Boolean | True if the definitions are equal |
GetHashCode()
Get the unique Hash representing the product definition.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The hash code as integer |