Class CurrencyDefinition
Represents a single currency configuration.
Inherited Members
Namespace: Unity.Services.Economy.Model
Assembly: Unity.Services.Economy.dll
Syntax
[Preserve]
public class CurrencyDefinition : ConfigurationItemDefinition
Constructors
CurrencyDefinition()
Declaration
[Preserve]
public CurrencyDefinition()
Fields
Initial
The amount of currency a player initially is given.
Declaration
[Preserve]
[JsonProperty("initial")]
[JsonRequired]
public int Initial
Field Value
Type | Description |
---|---|
int |
Max
(Optional, a value of 0 indicates no maximum) The maximum amount of this currency a player can own.
Declaration
[Preserve]
[JsonProperty("max")]
public int Max
Field Value
Type | Description |
---|---|
int |
Methods
GetPlayerBalanceAsync()
Gets the current balance of this currency for the currently signed in player. It is equivalent to the balance for this currency retrieved from EconomyService.Internal.PlayerBalances.GetBalancesAsync()
Declaration
public Task<PlayerBalance> GetPlayerBalanceAsync()
Returns
Type | Description |
---|---|
Task<PlayerBalance> | A PlayerBalance object containing the currency balance for this currency. |