docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PlayerBalance

    Represents a single currency balance for a player.

    Inheritance
    object
    PlayerBalance
    Inherited Members
    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 PlayerBalance

    Constructors

    PlayerBalance(string, long, string, EconomyDate, EconomyDate)

    Declaration
    [Preserve]
    public PlayerBalance(string currencyId = null, long balance = 0, string writeLock = null, EconomyDate created = null, EconomyDate modified = null)
    Parameters
    Type Name Description
    string currencyId
    long balance
    string writeLock
    EconomyDate created
    EconomyDate modified

    Fields

    Balance

    The amount of this currency the player has.

    Declaration
    [Preserve]
    public long Balance
    Field Value
    Type Description
    long

    Created

    The date this balance was created as an EconomyDate object.

    Declaration
    [Preserve]
    public EconomyDate Created
    Field Value
    Type Description
    EconomyDate

    CurrencyId

    The ID of the currency this balance represents.

    Declaration
    [Preserve]
    public string CurrencyId
    Field Value
    Type Description
    string

    Modified

    The date this balance was modified as an EconomyDate object.

    Declaration
    [Preserve]
    public EconomyDate Modified
    Field Value
    Type Description
    EconomyDate

    WriteLock

    The current WriteLock string.

    Declaration
    [Preserve]
    public string WriteLock
    Field Value
    Type Description
    string

    Methods

    GetCurrencyDefinition()

    Gets the currency definition for this balance.

    Declaration
    public CurrencyDefinition GetCurrencyDefinition()
    Returns
    Type Description
    CurrencyDefinition

    The CurrencyDefinition that this balance refers to.

    GetCurrencyDefinitionAsync()

    Gets the currency definition for this balance.

    Declaration
    [Obsolete("This has been replaced with GetCurrencyDefinition which is not asynchronous and should be accessed from there instead. This API will be removed in an upcoming release.", false)]
    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

    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)