private void OnSavedGameOpened(SavedGameRequestStatus status, ISavedGameMetadata game) { if (status == SavedGameRequestStatus.Success) { if (!isSaving) { //feedback.text = ("OnSaveGameOpened Loading"); LoadGame(game); } else { //feedback.text = ("OnSaveGameOpened Saving"); SaveGame(game); } } else { if (!isSaving) { LocalSaveEngine.LoadPlayer(); } else { LocalSaveEngine.SavePlayer(); } } }
public void SaveData() { if (!isCloudDataLoaded) { LocalSaveEngine.SavePlayer(); UnityEngine.Debug.Log("Save Game Cloud Data is not Loaded"); } if (Social.localUser.authenticated) { isSaving = true; ((PlayGamesPlatform)Social.Active).SavedGame.OpenWithAutomaticConflictResolution(SAVE_NAME, DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLongestPlaytime, OnSavedGameOpened); UnityEngine.Debug.Log("Saving game to cloud"); } else { LocalSaveEngine.SavePlayer(); UnityEngine.Debug.Log("Offline. Saving game locally"); } }