docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class CurrencyDefinition

    Represents a single currency configuration.

    Inheritance
    object
    ConfigurationItemDefinition
    CurrencyDefinition
    Inherited Members
    ConfigurationItemDefinition.Id
    ConfigurationItemDefinition.Name
    ConfigurationItemDefinition.Type
    ConfigurationItemDefinition.CustomData
    ConfigurationItemDefinition.CustomDataDeserializable
    ConfigurationItemDefinition.Created
    ConfigurationItemDefinition.Modified
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)