Beispiel #1
0
    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);
    }
Beispiel #2
0
 private void OnEnable()
 {
     if (PlayerDataManager.IsSubscribed())
     {
         offerContent.SetActive(value: false);
         subscribedContent.SetActive(value: true);
     }
     TankPrefs.SetInt("subOfferSeen", 1);
     TankPrefs.Save();
 }
Beispiel #3
0
 private static void HandleIsNewUser(bool isNewUser)
 {
     if (isNewUser)
     {
         TankPrefs.HasCloudBeenFetched = true;
         TankPrefs.SetInt("whatsNewSeen", 1);
         TankPrefs.SaveAtEndOfFrame();
     }
     else
     {
         TankPrefs.GetCloudSave(delegate(bool result)
         {
             if (result)
             {
                 if ((TankPrefs.LocalLoadSucceeded && !PlatformManager.ReconnectingWithGooglePlay) || TankPrefs.CloudSyncComplete)
                 {
                     return;
                 }
                 Time.timeScale = 0f;
                 MenuController.ShowMenu <CloudBackupPopup>().Init(TankPrefs.CloudFileTime.ToString(), delegate
                 {
                     TankGame.Running            = true;
                     Time.timeScale              = 1f;
                     TankPrefs.CloudSyncComplete = true;
                 }, delegate
                 {
                     PlayerDataManager.BeenInAppBefore = true;
                     Time.timeScale = 1f;
                     if (TankGame.Running)
                     {
                         TankGame.Running = false;
                         MenuController.HideMenu <GameMenu>();
                         LoadingScreen.ReloadGame(delegate
                         {
                             MenuController.ShowMenu <MainMenu>().UpdatePlayMenu();
                         });
                     }
                     else
                     {
                         MenuController.UpdateTopMenu();
                         MenuController.GetMenu <MainMenu>().UpdatePlayMenu();
                     }
                 });
             }
             else
             {
                 UnityEngine.Debug.LogError("Cloud save not yet gotten, will try again!");
                 HandleIsNewUser(isNewUser);
             }
             PlatformManager.ReconnectingWithGooglePlay = false;
         });
     }
 }
 private void Start()
 {
     TankPrefs.SetInt("facebookAsked", 1);
     TankPrefs.Save();
     button.SetToggled(BackendManager.ConnectedWithFacebook);
     button.SetOnClick(ButtonState.Default, delegate
     {
         button.SetDisabled();
         BackendManager.ConnectWithFacebook(delegate
         {
             button.SetToggled(toggled: true);
         }, delegate
         {
             button.SetToggled(toggled: false);
         });
     });
     proceedButton.onClick.AddListener(delegate
     {
         MenuController.HideMenu <FacebookPopup>();
     });
 }
 private void OnDisable()
 {
     TankPrefs.SetInt("privacyPolicyAgreed", 1);
     Time.timeScale = 1f;
 }
Beispiel #6
0
 private void SetSomeIAPBought()
 {
     TankPrefs.SetInt("someIAPBought", 1);
 }
Beispiel #7
0
 public static void SetVersion(int version)
 {
     TankPrefs.SetInt("version", version);
     TankPrefs.SaveAtEndOfFrame();
 }