RefreshOnGoodBalanceChanged() public static method

public static RefreshOnGoodBalanceChanged ( Soomla.Store.VirtualGood good, int balance, int amountAdded ) : void
good Soomla.Store.VirtualGood
balance int
amountAdded int
return void
Example #1
0
        public static void onGoodBalanceChanged(GoodBalanceChangedEvent _Event, bool alsoPush)
        {
            SoomlaWpStore.domain.virtualGoods.VirtualGood good = _Event.GetGood();
            int balance     = _Event.GetBalance();
            int amountAdded = _Event.GetAmountAdded();

            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onGoodBalanceChanged:" + good.getItemId() + " " + balance.ToString() + " " + amountAdded.ToString());

            VirtualGood vg = (VirtualGood)StoreInfo.GetItemByItemId(good.getItemId());

            StoreInventory.RefreshOnGoodBalanceChanged(vg, balance, amountAdded);
            StoreEvents.OnGoodBalanceChanged(vg, balance, amountAdded);

            if (alsoPush)
            {
                sep.PushEventOnGoodBalanceChanged(_Event);
            }
        }
Example #2
0
        public void onGoodBalanceChanged(string message, bool alsoPush)
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onGoodBalanceChanged:" + message);

            JSONObject eventJSON = new JSONObject(message);

            VirtualGood vg          = (VirtualGood)StoreInfo.GetItemByItemId(eventJSON["itemId"].str);
            int         balance     = (int)eventJSON["balance"].n;
            int         amountAdded = (int)eventJSON["amountAdded"].n;

            StoreInventory.RefreshOnGoodBalanceChanged(vg, balance, amountAdded);

            StoreEvents.OnGoodBalanceChanged(vg, balance, amountAdded);

            if (alsoPush)
            {
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
                sep.PushEventOnGoodBalanceChanged(vg, balance, amountAdded);
#endif
            }
        }