Пример #1
0
        public static async void CloudStorageInit()
        {
            cachedApiState = GoogleDriveService.EState.AuthInProgress;
            OnCloudStorageApiUpdate.Invoke(cachedApiState);

            try
            {
                await CloudStorage.InitFileList();
            }
            catch (Exception ex)
            {
                Logger.WriteLine("Exception: " + ex);
            }

            OnCloudStorageApiUpdate.Invoke(CloudStorage.GetState());

            var settingsDB = PlayerSettingsDB.Get();

            settingsDB.cloudToken = CloudStorage.GetAuthToken().refreshToken;

            bool needsSave = await CloudStorageLoad();

            cloudSettingsInitialized = true;

            if (needsSave)
            {
                await CloudStorageSave();
            }
        }
Пример #2
0
 public static void CloudStorageRequestState()
 {
     if (cachedApiState == GoogleDriveService.EState.NoErrors)
     {
         OnCloudStorageStateUpdate.Invoke(cachedSaveState);
     }
     else
     {
         OnCloudStorageApiUpdate.Invoke(cachedApiState);
     }
 }