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 } }
/// <summary> /// Handles an <c>onGoodUpgrade</c> event, which is fired when a specific <c>UpgradeVG</c> has /// been upgraded/downgraded. /// </summary> /// <param name="message">Message that contains information about the good that has been /// upgraded/downgraded.</param> public void onGoodUpgrade(string message) { SoomlaUtils.LogDebug(TAG, "SOOMLA/UNITY onGoodUpgrade:" + message); string[] vars = Regex.Split(message, "#SOOM#"); VirtualGood vg = (VirtualGood)StoreInfo.GetItemByItemId(vars[0]); UpgradeVG vgu = null; if (vars.Length > 1) { vgu = (UpgradeVG)StoreInfo.GetItemByItemId(vars[1]); } StoreEvents.OnGoodUpgrade(vg, vgu); }
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); } }