private static IEnumerator LoadCloudData(Action <CloudData> callback) { var loadedCloudData = false; PlayGamesServices.LoadCloudData(data => { loadedCloudData = true; callback.Invoke(data); }); yield return(new WaitUntil(() => loadedCloudData)); }
private void SyncCloudWithLocal() { ActivateAccountPanels(new[] { "loader" }); PlayGamesServices.LoadCloudData(cloudData => { var localData = LocalSaveSystem.LoadLocalData(); if (localData.SaveTime != cloudData.saveTime) { localData.Synchronized = true; localData.Characters = cloudData.characters; localData.Platforms = cloudData.platforms; localData.Environments = cloudData.environments; localData.SaveTime = cloudData.saveTime; localData.HighScore = cloudData.highScore; localData.Coins = cloudData.coins; UpdateGameData(localData); } ActivateAccountPanels(new[] { "signed" }); }); }