docs.unity.cn
    Show / Hide Table of Contents

    Interface IWalletManager

    Manages the player currency balances.

    Namespace: UnityEngine.GameFoundation
    Syntax
    public interface IWalletManager

    Methods

    Add(Currency, Int64)

    Increases the balance of the specified Currency.

    Declaration
    bool Add(Currency currency, long balance)
    Parameters
    Type Name Description
    Currency currency

    The currency you want to increase the balance.

    Int64 balance

    The amount to add to the balance.

    Returns
    Type Description
    Boolean

    true if the update is valid, false otherwise.

    Get(Currency)

    Gets the balance of the specified Currency.

    Declaration
    long Get(Currency currency)
    Parameters
    Type Name Description
    Currency currency

    The currency you want the balance of.

    Returns
    Type Description
    Int64

    The balance of the specified currency.

    Remove(Currency, Int64)

    Decreases the balance of the specified Currency.

    Declaration
    bool Remove(Currency currency, long balance)
    Parameters
    Type Name Description
    Currency currency

    The currency you want to decrease the balance.

    Int64 balance

    The amount to remove to the balance.

    Returns
    Type Description
    Boolean

    true if the update is valid, false otherwise.

    Set(Currency, Int64)

    Sets the balance of the specified Currency.

    Declaration
    bool Set(Currency currency, long balance)
    Parameters
    Type Name Description
    Currency currency

    The currency you want to set the balance.

    Int64 balance

    The amount to add to the balance.

    Returns
    Type Description
    Boolean

    true if the balance has been updated, false otherwise.

    Events

    balanceChanged

    Triggered every time a balance is modified, whether added, removed, or set.

    Declaration
    event Action<IQuantifiable, long> balanceChanged
    Event Type
    Type Description
    Action<IQuantifiable, Int64>
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 16 June 2021