Class ConfigurationBuilder
Builds configuration for Unity Purchasing, consisting of products and store specific configuration details.
Namespace: UnityEngine.Purchasing
Syntax
public class ConfigurationBuilder : object
Properties
products
The set of products in the catalog.
Declaration
public HashSet<ProductDefinition> products { get; }
Property Value
Type | Description |
---|---|
HashSet<ProductDefinition> |
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 |
---|---|
Boolean | True if the project will use the catalog stored on the cloud. |
useCloudCatalog
Obsolete. Please use useCatalogProvider instead.
Declaration
public bool useCloudCatalog { get; set; }
Property Value
Type | Description |
---|---|
Boolean | True it 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. |
ProductType | type | The type of the product. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | 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. |
ProductType | type | The type of the product. |
IDs | storeIDs | The object representing store IDs the product is to be added to. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | 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. |
ProductType | type | The type of the product. |
IDs | storeIDs | The object representing store IDs the product is to be added to. |
IEnumerable<PayoutDefinition> | payouts | The enumerator of the payout definitions of the product. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | 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. |
ProductType | type | The type of the product. |
IDs | storeIDs | The object representing store IDs the product is to be added to. |
PayoutDefinition | payout | The payout definition of the product. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | 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<ProductDefinition> | products | The enumerator of the product definitions to be added. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | 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, IPurchasingModule[])
Create an instance of the configuration builder.
Declaration
public static ConfigurationBuilder Instance(IPurchasingModule first, params IPurchasingModule[] rest)
Parameters
Type | Name | Description |
---|---|---|
IPurchasingModule | first | The first purchasing module. |
IPurchasingModule[] | rest | The remaining purchasing modules, excluding the one passes as first. |
Returns
Type | Description |
---|---|
ConfigurationBuilder | The instance of the configuration builder as specified. |