private void ApplyRocketTries(StoreProductData product) { if (GlobalRefs.MiniGamesScreen != null) { GlobalRefs.MiniGamesScreen.IncreaseTriesPaid(MiniGameType.BreakLiner); } }
private void OnStoreProductPurchased(StoreProductData data) { if (IsLoaded) { ToggleMainScreenButton(); } }
public void PurchaseProduct(StoreProductData product) { UDBG.Log($"start purchasing with store id: {product.StoreId}"); #if UNITY_EDITOR || BOSDEBUG ProductReward.Execute(product); return; #else if (product == null) { UDBG.Log($"Product what you try purchase is NULL".Attrib(bold: true, italic: true, color: "r")); return; } if (!IsInitialized) { UDBG.LogError($"UnityPurchasing is not initialized".Attrib(bold: true, italic: true, color: "r")); return; } Product unityProduct = storeController.products.WithID(product.StoreId); if (unityProduct == null) { UDBG.Log($"Purchase error: product with store ID: {product.StoreId} is NULL".Attrib(bold: true, italic: true, color: "r")); return; } if (false == unityProduct.availableToPurchase) { UDBG.Log($"Purchase error: product with store ID: {product.StoreId} is not available to purchase".Attrib(bold: true, italic: true, color: "r")); return; } CreateLoadingScreen(); storeController.InitiatePurchase(unityProduct); #endif }
private void ApplyProfitUpgrade(StoreProductData product) { services.GenerationService.Generators.AddProfitBoost( boost: BoostInfo.CreateTemp( id: $"iap_{product.StoreId}_".GuidSuffix(5), value: product.BonusValue)); }
private void ApplyTreasureHuntTries(StoreProductData product) { if (GlobalRefs.MiniGamesScreen != null) { GlobalRefs.MiniGamesScreen.IncreaseTriesPaid(MiniGameType.TreasureHunt); } }
private void ApplyPrizeWheelTries(StoreProductData product) { if (GlobalRefs.MiniGamesScreen != null) { GlobalRefs.MiniGamesScreen.IncreaseTriesPaid(MiniGameType.PrizeWheel); } }
public Option <Product> GetProductByResourceId(int id) { if (IsInitialized) { StoreProductData productData = ResourceService.Products.GetProduct(id); if (productData != null) { return(GetProductByStoreId(productData.StoreId)); } } return(F.None); }
public void Execute(StoreProductData product) { services.PlayerService.AddCoins(product.Coins); StatsCollector.Instance[Stats.MONEY_SPENT] += product.Price; if (product.HasBonus) { if (bonusMap.ContainsKey(product.BonusType)) { bonusMap[product.BonusType](product); } else { UDBG.Log($"not founded bonus purchase handler {product.BonusType} for product {product.StoreId}".Attrib(bold: true, italic: true, color: "r")); } } GameEvents.StoreProductPurchasedObservable.OnNext(product); GameEvents.OnStoreProductPurchased(product); }
static void Postfix() { if (!enabled) { return; } foreach (Weapon weapon in weapons) { StoreProductData spdata = new StoreProductData() { productId = weapon.productId, itemId = weapon.itemId, currency_itemId = weapon.currency, exchangeRateData = weapon.exchange, reqMissionId = weapon.requireMissions, isLimited = false, dlcRequired = "", }; typeof(StoreProductData).GetMethod("Init", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(spdata, new object[] { }); StoreProductData.refDataDic.Add(spdata); } }
static void Postfix() { if (!enabled) { return; } foreach (StoreItem item in storeItems) { StoreProductData spdata = new StoreProductData() { productId = item.productId, itemId = item.itemId, currency_itemId = item.currency, exchangeRateData = item.exchange, reqMissionId = item.requireMissions, isLimited = false, dlcRequired = "", }; Dbgl($"added item to store database: {ItemDataMgr.Self.GetItemName(item.itemId)}"); typeof(StoreProductData).GetMethod("Init", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(spdata, new object[] { }); StoreProductData.refDataDic.Add(spdata); } }
private double GetSoldCurrencyValue(StoreProductData data) { return(GetMaxCurrencyValue(data) * data.BonusValue); }
public static void OnStoreProductPurchased(StoreProductData data) => StoreProductPurchasedEvent?.Invoke(data);
private void ApplyCompanyCash(StoreProductData product) { var Player = services.PlayerService; Player.AddGenerationCompanyCash(Player.MaxCompanyCash * product.BonusValue); }
private void ApplyLootbox(StoreProductData product) { services.RewardsService.AddAvailableRewards(product.BonusValue); }
private double GetMaxCurrencyValue(StoreProductData data) { return(Services.PlayerService.GetCurrencyMaxValue(data.CurrencyType)); }
private void ApplySpecialOffer(StoreProductData product) { services.GetService <ISpecialOfferService>().OnOfferPurchased(); }
private void ApplyPlayerCash(StoreProductData product) { services.PlayerService.AddPlayerCash(new CurrencyNumber(services.PlayerService.MaxPlayerCash * product.BonusValue)); }
private void ApplySecurities(StoreProductData product) { services.PlayerService.AddSecurities(new CurrencyNumber(services.PlayerService.MaxSecurities * product.BonusValue)); }