Exemplo n.º 1
0
    private void OnApplicationPause()
    {
        if (dataScores == null || dataScores.Count == 0)
        {
            return;
        }

        PlayerDataSerialize dataSerialize = new PlayerDataSerialize();

        dataSerialize.dataScores = dataScores.ToArray();

        dataController.SaveData <PlayerDataSerialize>(dataSerialize, FileType.progress);
        dataController.SavePlayerProgress();
    }
Exemplo n.º 2
0
    void InitializeData()
    {
        table_elements = ratingTable.GetComponentsInChildren <TextMeshProUGUI>();
        dataController = new DataController(gameEvents);

        PlayerDataSerialize dataSerialize = dataController.LoadData <PlayerDataSerialize>(FileType.progress);

        if (dataSerialize != null && dataSerialize.dataScores != null && dataSerialize.dataScores.Length > 0)
        {
            dataScores = dataSerialize.dataScores.ToList();
            UpdateTable();
        }
        else
        {
            dataScores = new List <DataScores>();
        }

        dataController.LoadPlayerProgress();
        RefreshUIElements();
    }