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

        player_coins = loadedDataCoins.coins;

        PlayerCoins_Text.text = player_coins.ToString("F0");
    }
    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);
    }
Пример #3
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);
    }