RefreshOnGoodUpgrade() public static method

public static RefreshOnGoodUpgrade ( Soomla.Store.VirtualGood vg, UpgradeVG uvg ) : void
vg Soomla.Store.VirtualGood
uvg UpgradeVG
return void
Ejemplo n.º 1
0
        public void onGoodUpgrade(string message, bool alsoPush)
        {
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onGoodUpgrade:" + message);

            var eventJSON = new JSONObject(message);

            VirtualGood vg  = (VirtualGood)StoreInfo.GetItemByItemId(eventJSON["itemId"].str);
            UpgradeVG   vgu = null;

            if (eventJSON.HasField("upgradeItemId") && !string.IsNullOrEmpty(eventJSON["upgradeItemId"].str))
            {
                vgu = (UpgradeVG)StoreInfo.GetItemByItemId(eventJSON["upgradeItemId"].str);
            }

            StoreInventory.RefreshOnGoodUpgrade(vg, vgu);

            StoreEvents.OnGoodUpgrade(vg, vgu);

            if (alsoPush)
            {
#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR
                sep.PushEventOnGoodUpgrade(vg, vgu);
#endif
            }
        }
Ejemplo n.º 2
0
        public static void onGoodUpgrade(GoodUpgradeEvent _Event, bool alsoPush)
        {
            SoomlaWpStore.domain.virtualGoods.VirtualGood good      = _Event.GetGood();
            SoomlaWpStore.domain.virtualGoods.UpgradeVG   upgradeVG = _Event.GetUpgradeVG();
            SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onGoodUpgrade:" + good.getItemId() + " " + upgradeVG.getItemId());

            VirtualGood vg  = (VirtualGood)StoreInfo.GetItemByItemId(good.getItemId());
            UpgradeVG   vgu = null;

            if (upgradeVG != null)
            {
                vgu = (UpgradeVG)StoreInfo.GetItemByItemId(upgradeVG.getItemId());
            }
            StoreInventory.RefreshOnGoodUpgrade(vg, vgu);
            StoreEvents.OnGoodUpgrade(vg, vgu);

            if (alsoPush)
            {
                sep.PushEventOnGoodUpgrade(_Event);
            }
        }