public static RefreshOnCurrencyBalanceChanged ( Soomla.Store.VirtualCurrency virtualCurrency, int balance, int amountAdded ) : void | ||
virtualCurrency | Soomla.Store.VirtualCurrency | |
balance | int | |
amountAdded | int | |
return | void |
public void onCurrencyBalanceChanged(string message, bool alsoPush) { SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onCurrencyBalanceChanged:" + message); JSONObject eventJSON = new JSONObject(message); VirtualCurrency vc = (VirtualCurrency)StoreInfo.GetItemByItemId(eventJSON["itemId"].str); int balance = (int)eventJSON["balance"].n; int amountAdded = (int)eventJSON["amountAdded"].n; StoreInventory.RefreshOnCurrencyBalanceChanged(vc, balance, amountAdded); StoreEvents.OnCurrencyBalanceChanged(vc, balance, amountAdded); if (alsoPush) { #if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR sep.PushEventOnCurrencyBalanceChanged(vc, balance, amountAdded); #endif } }
public static void onCurrencyBalanceChanged(CurrencyBalanceChangedEvent _Event, bool alsoPush) { SoomlaWpStore.domain.virtualCurrencies.VirtualCurrency currency = _Event.GetCurrency(); int balance = _Event.GetBalance(); int amountAdded = _Event.GetAmountAdded(); SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onCurrencyBalanceChanged" + currency.getItemId() + " " + balance.ToString() + " " + amountAdded.ToString()); VirtualCurrency vc = (VirtualCurrency)StoreInfo.GetItemByItemId(currency.getItemId()); StoreEvents.OnCurrencyBalanceChanged(vc, balance, amountAdded); StoreInventory.RefreshOnCurrencyBalanceChanged(vc, balance, amountAdded); //Why this line was added twice ?? //StoreEvents.OnCurrencyBalanceChanged(vc, balance, amountAdded); if (alsoPush) { sep.PushEventOnCurrencyBalanceChanged(_Event); } }