docs.unity3d.com
    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.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Services.Economy.Model
    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]
    public int Initial
    Field Value
    Type Description
    Int32

    Max

    (Optional, a value of 0 indicates no maximum) The maximum amount of this currency a player can own.

    Declaration
    [Preserve]
    public int Max
    Field Value
    Type Description
    Int32

    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 async Task<PlayerBalance> GetPlayerBalanceAsync()
    Returns
    Type Description
    Task<PlayerBalance>

    A PlayerBalance object containing the currency balance for this currency.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023