Class ProductDefinition
Product definition used by Apps declaring products for sale.
Inherited Members
Namespace: UnityEngine .Purchasing
Assembly: solution.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. |
Product |
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. |
Product |
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. |
Product |
type | The product type. |
bool | enabled | Whether the product is enabled for purchase or not. |
IEnumerable<Payout |
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. |
Product |
type | The product type. |
bool | enabled | Whether the product is enabled for purchase or not. |
Payout |
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. |
Product |
type | The product type. |
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 |
---|---|
Payout |
The payout. |
payouts
Gets all payouts attached to this product.
Declaration
public IEnumerable<PayoutDefinition> payouts { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Payout |
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 |
---|---|
Product |
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
GetHashCode()
Get the unique Hash representing the product definition.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code as integer |