public void Load_PlayerCoins()
    {
        PlayerDataCoins loadedDataCoins = SaveLoadCoins.LoadPlayer();

        player_coins = loadedDataCoins.coins;

        PlayerCoins_Text.text = player_coins.ToString("F0");
    }
    public void SaveCoins()
    {
        PlayerDataCoins SaveDataCoins = new PlayerDataCoins();

        SaveDataCoins.coins = player_coins;
        SaveLoadCoins.SavePlayer(SaveDataCoins);

        Load_PlayerCoins();
    }
    public void RESET_ALL()
    {
        PlayerDataCustomize SaveDataCustomize = new PlayerDataCustomize();

        SaveDataCustomize.color_no       = 0;
        SaveDataCustomize.selected_color = 0;
        SaveDataCustomize.trail_no       = 0;
        SaveDataCustomize.selected_trail = 0;
        SaveLoadCustomize.SavePlayer(SaveDataCustomize);

        Player_Idle.GetComponent <Image>().color = Colors[0].gameObject.GetComponent <Image>().color;

        Change_Trail(0);

        PlayerDataLocked SaveDataLocked = new PlayerDataLocked();

        SaveDataLocked.color_0_locked = false;
        SaveDataLocked.color_1_locked = true;
        SaveDataLocked.color_2_locked = true;
        SaveDataLocked.color_3_locked = true;
        SaveDataLocked.color_4_locked = true;

        SaveDataLocked.trail_0_locked = false;
        SaveDataLocked.trail_1_locked = true;
        SaveDataLocked.trail_2_locked = true;
        SaveLoadLocked.SavePlayer(SaveDataLocked);

        PlayerDataCoins SaveDataCoins = new PlayerDataCoins();

        SaveDataCoins.coins = 0;
        SaveLoadCoins.SavePlayer(SaveDataCoins);

        PlayerDataHighscore SaveDataHighscore = new PlayerDataHighscore();

        SaveDataHighscore.highscore = 0;
        SaveLoadHighscore.SavePlayer(SaveDataHighscore);

        PlayerDataVolumes SaveDataVolumes = new PlayerDataVolumes();

        SaveDataVolumes.m_volume = 3;
        SaveDataVolumes.s_volume = 3;
        SaveLoadVolumes.SavePlayer(SaveDataVolumes);

        PlayerDataQuality SaveDataQuality = new PlayerDataQuality();

        SaveDataQuality.quality_selection = 1;
        SaveLoadQuality.SavePlayer(SaveDataQuality);

        Load_Customization();
        Load_PlayerCoins();
        Load_Locked();
        Load_Volumes();
        Load_QualitySettings();
        Load_Highscore();
    }
    public void Save_Coin()
    {
        PlayerDataCoins loadedDataCoins = SaveLoadCoins.LoadPlayer();
        int             loaded_coins    = loadedDataCoins.coins;

        int total_coins = loaded_coins + current_coins;

        PlayerDataCoins SaveDataCoins = new PlayerDataCoins();

        SaveDataCoins.coins = total_coins;
        SaveLoadCoins.SavePlayer(SaveDataCoins);
    }
Example #5
0
    public void Calculate_Coin()
    {
        string Highscore_Current = Movement.current_score.ToString("F0");
        int    highscore_current = int.Parse(Highscore_Current);
        int    carrot_count      = Carrot_Collector.Carrot_C.carrot_ct;

        int coin = (highscore_current / 500) + (carrot_count * 2);

        Coin_UI.text = coin.ToString();

        PlayerDataCoins loadedData = SaveLoadCoins.LoadPlayer();

        total_coins = loadedData.Coins;

        total_coins += coin;

        PlayerDataCoins saveDataCoins = new PlayerDataCoins();

        saveDataCoins.Coins = total_coins;
        SaveLoadCoins.SavePlayer(saveDataCoins);
    }