Class Configuration
This class allows you to retrieve items from the global economy configuration as it is set up in the Unity Dashboard.
Namespace: Unity.Services.Economy
Syntax
public class Configuration : object
Methods
GetCurrenciesAsync()
Gets the Currencies that have been configured and published in the Unity Dashboard.
Declaration
public Task<List<CurrencyDefinition>> GetCurrenciesAsync()
Returns
| Type | Description |
|---|---|
| Task<List<CurrencyDefinition>> | A list of CurrencyDefinition |
Exceptions
| Type | Condition |
|---|---|
| EconomyException | Thrown if request is unsuccessful |
GetCurrencyAsync(String)
Gets a Currency Definition for a specific currency.
Declaration
public Task<CurrencyDefinition> GetCurrencyAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | The configuration ID of the currency to fetch. |
Returns
| Type | Description |
|---|---|
| Task<CurrencyDefinition> | A CurrencyDefinition for the specified currency, or null if the currency doesn't exist. |
Exceptions
| Type | Condition |
|---|---|
| EconomyException | Thrown if request is unsuccessful |
GetInventoryItemAsync(String)
Gets a InventoryItemDefinition for a specific currency.
Declaration
public Task<InventoryItemDefinition> GetInventoryItemAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | The configuration ID of the item to fetch. |
Returns
| Type | Description |
|---|---|
| Task<InventoryItemDefinition> | A InventoryItemDefinition for the specified currency, or null if the currency doesn't exist. |
Exceptions
| Type | Condition |
|---|---|
| EconomyException | Thrown if request is unsuccessful |
GetInventoryItemsAsync()
Gets the Inventory Items that have been configured and published in the Unity Dashboard.
Declaration
public Task<List<InventoryItemDefinition>> GetInventoryItemsAsync()
Returns
| Type | Description |
|---|---|
| Task<List<InventoryItemDefinition>> | A list of InventoryItemDefinition |
Exceptions
| Type | Condition |
|---|---|
| EconomyException | Thrown if request is unsuccessful |
GetRealMoneyPurchaseAsync(String)
Gets a RealMoneyPurchaseDefinition for a specific real money purchase.
Declaration
public Task<RealMoneyPurchaseDefinition> GetRealMoneyPurchaseAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | The ID of the purchase to retrieve |
Returns
| Type | Description |
|---|---|
| Task<RealMoneyPurchaseDefinition> | A RealMoneyPurchaseDefinition for the specified purchase if it exists, or null otherwise. |
Exceptions
| Type | Condition |
|---|---|
| EconomyException | Thrown if request is unsuccessful |
GetRealMoneyPurchasesAsync()
Gets all the real money purchases currently configured and published in the Economy Dashboard.
Declaration
public Task<List<RealMoneyPurchaseDefinition>> GetRealMoneyPurchasesAsync()
Returns
| Type | Description |
|---|---|
| Task<List<RealMoneyPurchaseDefinition>> | A list of RealMoneyPurchaseDefinition |
Exceptions
| Type | Condition |
|---|---|
| EconomyException | Thrown if request is unsuccessful |
GetVirtualPurchaseAsync(String)
Gets a VirtualPurchaseDefinition for a specific virtual purchase.
Note that this will also fetch the associated Inventory Items/Currencies associated with this purchase.
Declaration
public Task<VirtualPurchaseDefinition> GetVirtualPurchaseAsync(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| String | id | The ID of the purchase to retrieve |
Returns
| Type | Description |
|---|---|
| Task<VirtualPurchaseDefinition> | A VirtualPurchaseDefinition for the specified purchase if it exists, or null otherwise. |
Exceptions
| Type | Condition |
|---|---|
| EconomyException | Thrown if request is unsuccessful |
GetVirtualPurchasesAsync()
Gets all the virtual purchases currently configured and published in the Economy Dashboard.
Note that this will also fetch all associated Inventory Items/Currencies associated with the purchase.
Declaration
public Task<List<VirtualPurchaseDefinition>> GetVirtualPurchasesAsync()
Returns
| Type | Description |
|---|---|
| Task<List<VirtualPurchaseDefinition>> | A list of VirtualPurchaseDefinition |
Exceptions
| Type | Condition |
|---|---|
| EconomyException | Thrown if request is unsuccessful |