private void SaveRemote()
 {
     SGSaveLoad.UploadXML(tests_currentGamePlayer, tests_currentGamePlayer.scene.ToString());
     //SGSaveLoad.RemoveXML(tests_currentGamePlayer.scene.ToString());
     trySaveRemote = true;
     timecount     = 0f;
 }
    private void GetValues(DataSnapshot snapshot)
    {
        ClearSavedList();

        foreach (var childSnapshot in snapshot.Children)
        {
            SGSaveLoad.ConvertXMLToObject(tests_currentGamePlayer, childSnapshot.Value);
            AddSavedList();
        }
    }
    public void OnClick()
    {
        // restore sounds
        SGSound.SoundLevel = 1;
        SGSound.MusicLevel = 1;

        // restore storages
        SGStorage.ClearGenericPrefs();

        // delete files
        SGSaveLoad.DeleteLocal();

        // load boot scene
        StartCoroutine(SGEnvironment.Quit());
    }
    public void OnClick_SaveLoadLocal()
    {
        img.color = Color.red;
        // binary, with list
        if (AddSavedList())
        {
            if (SGSaveLoad.SaveLocal(tests_listGamesPlayer))
            {
                Debug.LogWarning(tests_listGamesPlayer.Count);
                tests_listGamesPlayer.Clear();
                tests_listGamesPlayer = SGSaveLoad.LoadLocal <List <test_GamePlayer> >();
                if (tests_listGamesPlayer.Count > 0)
                {
                    Debug.LogWarning(tests_listGamesPlayer.Count);
                    SGDebug.LogText = "Save/Load successful!: " + SGSaveLoad.LocalFilePath;

                    img.color = Color.blue;
                }
            }
        }

        // xml
        string key = tests_currentGamePlayer.scene.ToString();

        if (SGSaveLoad.SaveLocalXML(tests_currentGamePlayer, key))
        {
            Debug.LogWarning(tests_currentGamePlayer.levelName);
            tests_currentGamePlayer = null;
            tests_currentGamePlayer = SGSaveLoad.LoadLocalXML <test_GamePlayer>(key);
            if (tests_currentGamePlayer.scene > 0)
            {
                Debug.LogWarning(tests_currentGamePlayer.levelName);
                SGDebug.LogText = "Save/Load successful!: " + SGSaveLoad.LocalFilePath;
                img.color       = Color.blue;
            }
        }

        // remote
        SaveRemote();
    }
 private void LoadRemote()
 {
     SGSaveLoad.DownloadXMLs();
     tryLoadRemote = true;
     timecount     = 0f;
 }