Class ConfigurationBuilder
Builds configuration for Unity Purchasing, consisting of products and store specific configuration details.
Inherited Members
Namespace: UnityEngine .Purchasing
Assembly: solution.dll
Syntax
public class ConfigurationBuilder
Properties
logUnavailableProducts
Whether or not unavailable products should be logged as warnings
Declaration
public bool logUnavailableProducts { get; set; }
Property Value
Type | Description |
---|---|
bool |
products
The set of products in the catalog.
Declaration
public HashSet<ProductDefinition> products { get; }
Property Value
Type | Description |
---|---|
Hash |
useCatalogProvider
Whether or not the project will use the catalog stored on the cloud or the one cached locally.
Declaration
public bool useCatalogProvider { get; set; }
Property Value
Type | Description |
---|---|
bool | True if the project will use the catalog stored on the cloud. |
Methods
AddProduct(string, ProductType)
Add a product to the configuration builder.
Declaration
public ConfigurationBuilder AddProduct(string id, ProductType type)
Parameters
Type | Name | Description |
---|---|---|
string | id | The id of the product. |
Product |
type | The type of the product. |
Returns
Type | Description |
---|---|
Configuration |
The instance of the configuration builder with the new product added. |
AddProduct(string, ProductType, IDs)
Add a product to the configuration builder.
Declaration
public ConfigurationBuilder AddProduct(string id, ProductType type, IDs storeIDs)
Parameters
Type | Name | Description |
---|---|---|
string | id | The id of the product. |
Product |
type | The type of the product. |
IDs | storeIDs | The object representing store IDs the product is to be added to. |
Returns
Type | Description |
---|---|
Configuration |
The instance of the configuration builder with the new product added. |
AddProduct(string, ProductType, IDs, IEnumerable<PayoutDefinition>)
Add a product to the configuration builder.
Declaration
public ConfigurationBuilder AddProduct(string id, ProductType type, IDs storeIDs, IEnumerable<PayoutDefinition> payouts)
Parameters
Type | Name | Description |
---|---|---|
string | id | The id of the product. |
Product |
type | The type of the product. |
IDs | storeIDs | The object representing store IDs the product is to be added to. |
IEnumerable<Payout |
payouts | The enumerator of the payout definitions of the product. |
Returns
Type | Description |
---|---|
Configuration |
The instance of the configuration builder with the new product added. |
AddProduct(string, ProductType, IDs, PayoutDefinition)
Add a product to the configuration builder.
Declaration
public ConfigurationBuilder AddProduct(string id, ProductType type, IDs storeIDs, PayoutDefinition payout)
Parameters
Type | Name | Description |
---|---|---|
string | id | The id of the product. |
Product |
type | The type of the product. |
IDs | storeIDs | The object representing store IDs the product is to be added to. |
Payout |
payout | The payout definition of the product. |
Returns
Type | Description |
---|---|
Configuration |
The instance of the configuration builder with the new product added. |
AddProducts(IEnumerable<ProductDefinition>)
Add multiple products to the configuration builder.
Declaration
public ConfigurationBuilder AddProducts(IEnumerable<ProductDefinition> products)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Product |
products | The enumerator of the product definitions to be added. |
Returns
Type | Description |
---|---|
Configuration |
The instance of the configuration builder with the new product added. |
Configure<T>()
Configure the store as specified by the template parameter.
Declaration
public T Configure<T>() where T : IStoreConfiguration
Returns
Type | Description |
---|---|
T | The store configuration as an object. |
Type Parameters
Name | Description |
---|---|
T | Implementation of |
Instance(IPurchasingModule, params IPurchasingModule[])
Create an instance of the configuration builder.
Declaration
public static ConfigurationBuilder Instance(IPurchasingModule first, params IPurchasingModule[] rest)
Parameters
Type | Name | Description |
---|---|---|
IPurchasing |
first | The first purchasing module. |
IPurchasing |
rest | The remaining purchasing modules, excluding the one passes as first. |
Returns
Type | Description |
---|---|
Configuration |
The instance of the configuration builder as specified. |