Search Unity

Feature Request Can we have a GetBalanceAsync for a specific balance?

Discussion in 'Economy' started by Meresman, Jan 22, 2023.

  1. Meresman

    Meresman

    Joined:
    Sep 15, 2019
    Posts:
    9
    Hi, for now we only have increment/decrement functions
    I was wondering if we can get the current balance for checkups instead of incrementing by 0 as a workaround.


    for example:
    var currentBalance = await EconomyService.Instance.PlayerBalances.GetBalanceAsync("BALANCE_NAME");


    Thanks,
     
    Laurie-Unity likes this.
  2. Laurie-Unity

    Laurie-Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    220
    Hi @Meresman,

    Thanks for the suggestion. I will add a feature request for an the addition of an additional method to retieve the balance of a single currency.

    There is already an existing method to retrieve the balance of all the player's currencies at once.
    GetBalancesAsync()

    e.g.
    GetBalancesResult getBalancesResult = await EconomyService.Instance.PlayerBalances.GetBalancesAsync(options);