Ejemplo n.º 1
0
 private void OnEnable()
 {
     cancelCloudSaveButton.onClick.AddListener(delegate
     {
         MenuController.HideMenu <CloudSavePopup>();
     });
     if (BackendManager.IsAuthenticated)
     {
         cloudSaveLoadingContainer.SetActive(value: true);
         cloudSaveLoadedContainer.SetActive(value: false);
         cloudSaveLoadedSuccessContainer.SetActive(value: false);
         TankPrefs.GetCloudSave(delegate(bool result)
         {
             if (result)
             {
                 SetActiveCloudSavePopup(TankPrefs.LocalFileTime.ToString(), TankPrefs.CloudFileTime.ToString(), null, TankPrefs.OverrideLocalWithCloudData);
             }
         });
     }
     else
     {
         cloudSaveLoadingContainer.SetActive(value: true);
         PlatformManager.ReconnectWithGooglePlay(delegate
         {
             cloudSaveLoadingContainer.SetActive(value: false);
             MenuController.HideMenu <CloudSavePopup>();
         });
     }
 }
Ejemplo n.º 2
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;
         });
     }
 }