Example #1
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;
         });
     }
 }
Example #2
0
 public static void SetVersion(int version)
 {
     TankPrefs.SetInt("version", version);
     TankPrefs.SaveAtEndOfFrame();
 }