public static void Process() { int version = GetVersion(); if (version == 0) { NotificationManager.RemoveNotificationsOfType("dailyReward"); NotificationManager.ResetNotificationBadge(); } if (version < 203) { for (int i = 0; i != Variables.instance.levels.Count; i++) { if (PlayerDataManager.GetLeaderboardScore(Variables.instance.levels[i].leaderboard) > 0) { TankPrefs.SetInt("level" + i + "Unlocked", 1); } } } if (version < 210) { Variables.Bundle[] bundles = Variables.instance.bundles; int num = bundles.Length - 1; TankPrefs.SetInt("bundleStopIndex", TankPrefs.GetInt("bundleIndex", -1)); TankPrefs.SetInt("bundleIndex", num); TankPrefs.SetInt("bundleCounter", bundles[num].showAfterTimesTried + 3); PlayerDataManager.SetCurrentAdventureLevel(PlayerDataManager.GetSelectedLevel()); } if (version > 0 && version < CurrentVersionNumber && PlayerDataManager.BeenInAppBefore) { MenuController.ShowMenu <WhatsNewPopup>(); } SetVersion(CurrentVersionNumber); }
private IEnumerator LoginAfterInitialization() { while (!TankPrefs.IsInitialized || TankPrefs.GetInt("privacyPolicyAgreed") == 0) { yield return(null); } ConnectWithPlayGamesServices(); LoadingScreen.AddProgress(0.1f); }
private void OnEnable() { PlayerDataManager.SelectedArenaLevel = Random.Range(0, Variables.instance.levels.Count - 1); dailyOffers = new ShopMenu.ShopItem[0]; if (PlayerDataManager.HasActiveDailyOffer()) { dailyOffers = PlayerDataManager.GetActiveDailyOffers(); } garageContainer.SetActive(value: true); for (int i = 0; i < tanks.Length; i++) { tanks[i].ResetCannon(); int num = Variables.instance.tankOrder[i]; tanks[i].BulletTypeIndex = num; tanks[i].BulletDef = Variables.instance.tanks[num].bullet; } int num2 = (PlayerDataManager.SelectedGameMode == GameMode.Adventure || PlayerDataManager.SelectedGameMode == GameMode.Classic) ? PlayerDataManager.GetSelectedLevel(PlayerDataManager.SelectedGameMode) : PlayerDataManager.SelectedArenaLevel; for (int j = 0; j < garageBackgrounds.Length; j++) { garageBackgrounds[j].SetActive(j == num2); } SetTank(PlayerDataManager.GetSelectedTank()); nextTankButton.gameObject.SetActive(tankIndex != tanks.Length - 1); prevTankButton.gameObject.SetActive(tankIndex != 0); StartCoroutine(StatSlider()); StartCoroutine(TankScrollRoutine()); FinishTankFlash(); MenuController.Delay(0.1f, delegate { Product bundleProduct = null; if (PlayerDataManager.IsTimeForDailyBonus()) { popupShownOnPreviousOpen = true; MenuController.ShowMenu <RewardCalendarPopup>(); } else if (popupShownOnPreviousOpen) { popupShownOnPreviousOpen = false; } else if (PlayerDataManager.IsTimeToShowBundle(out bundleProduct)) { popupShownOnPreviousOpen = true; MenuController.ShowMenu <BundlePopup>().SetIAP(bundleProduct); } else if (TankPrefs.GetInt("subOfferSeen") == 0) { popupShownOnPreviousOpen = true; MenuController.ShowMenu <SubscriptionOfferPopup>().Init("GarageOffer"); } else if (PlayerDataManager.IsTimeForFacebookPrompt()) { popupShownOnPreviousOpen = true; //MenuController.ShowMenu<FacebookPopup>(); } else if (PlayerDataManager.AskRating()) { popupShownOnPreviousOpen = true; //MenuController.ShowMenu<RatingPopup>(); } }); }
public static bool GetSomeIAPBought() { return(TankPrefs.GetInt("someIAPBought") == 1); }
public static int GetVersion() { return(TankPrefs.GetInt("version")); }