private void OnSavedGameOpened(SavedGameRequestStatus status, ISavedGameMetadata game)
 {
     if (status == SavedGameRequestStatus.Success)
     {
         if (!isSaving)
         {
             LoadGame(game);
         }
         else
         {
             SaveGame(game);
         }
     }
     else
     {
         if (!isSaving)
         {
             LocalSaveSystem.LoadSplit(LocalSaveSystem.Load());
         }
         else
         {
             LocalSaveSystem.LocalSave(GameDataToString());
         }
     }
 }
 public void LoadData()
 {
     if (Social.Active.localUser.authenticated)
     {
         isSaving = false;
         ((PlayGamesPlatform)Social.Active).SavedGame.OpenWithAutomaticConflictResolution(SAVE_NAME,
                                                                                          DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLongestPlaytime, OnSavedGameOpened);
     }
     else
     {
         //local load
         LocalSaveSystem.LoadSplit(LocalSaveSystem.Load());
     }
 }
    private void OnSavedGameDataRead(SavedGameRequestStatus status, byte[] savedData)
    {
        if (status == SavedGameRequestStatus.Success)
        {
            if (savedData != null)
            {
                string cloudDataString = Encoding.ASCII.GetString(savedData);

                if (cloudDataString != "")
                {
                    LocalSaveSystem.LoadSplit(savedData);
                    isCloudDataLoaded = true;
                }
                else
                {
                    LocalSaveSystem.LoadSplit(LocalSaveSystem.Load());
                }
            }
            else
            {
                LocalSaveSystem.LoadSplit(LocalSaveSystem.Load());
            }
        }
    }