Class PlayerBalance
Represents a single currency balance for a player.
Namespace: Unity.Services.Economy.Model
Syntax
public class PlayerBalance : object
Constructors
PlayerBalance(String, Int64, String, EconomyDate, EconomyDate)
Declaration
public PlayerBalance(string currencyId = null, long balance = null, string writeLock = null, EconomyDate created = null, EconomyDate modified = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | currencyId | |
| Int64 | balance | |
| String | writeLock | |
| EconomyDate | created | |
| EconomyDate | modified |
Fields
Balance
The amount of this currency the player has.
Declaration
public long Balance
Field Value
| Type | Description |
|---|---|
| Int64 |
Created
The date this balance was created as an EconomyDate object.
Declaration
public EconomyDate Created
Field Value
| Type | Description |
|---|---|
| EconomyDate |
CurrencyId
The ID of the currency this balance represents.
Declaration
public string CurrencyId
Field Value
| Type | Description |
|---|---|
| String |
Modified
The date this balance was modified as an EconomyDate object.
Declaration
public EconomyDate Modified
Field Value
| Type | Description |
|---|---|
| EconomyDate |
WriteLock
The current WriteLock string.
Declaration
public string WriteLock
Field Value
| Type | Description |
|---|---|
| String |
Methods
GetCurrencyDefinitionAsync()
Gets the currency definition for this balance.
Declaration
public Task<CurrencyDefinition> GetCurrencyDefinitionAsync()
Returns
| Type | Description |
|---|---|
| Task<CurrencyDefinition> | The CurrencyDefinition that this balance refers to. |
Exceptions
| Type | Condition |
|---|---|
| EconomyException | Thrown if request is unsuccessful |