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(); } }
public static void CloudStorageRequestState() { if (cachedApiState == GoogleDriveService.EState.NoErrors) { OnCloudStorageStateUpdate.Invoke(cachedSaveState); } else { OnCloudStorageApiUpdate.Invoke(cachedApiState); } }