how to have save and load system. With this programing,How to do a save and load system on mobile. With this programing

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using static System.Math;

[System.Serializable]
public class Data
{
public double trx;

// Upgrade 1
public double u1Cost
{
    get
    {
        return 5 * Pow(1.15, u1Level);
    }
}
public double u1Level;
public float u1Timer;
public float u1TimeCap;
public double u1Mult;
public double u1Power
{
  get 
    {
     return u1Level * u1Mult;
    }
}
public bool u1Auto;

// Upgrade 2
public double u2Cost
{
    get
    {
        return 250 * Pow(1.16, u2Level);
    }
}
public double u2Level;
public float u2Timer;
public float u2TimeCap;
public double u2Mult;
public double u2Power
{
    get
    {
        return 10 * u2Level * u2Mult;
    }
}
public bool u2Auto;

// Upgrade 3
public double u3Cost
{
    get
    {
        return 18750 * Pow(1.17, u3Level);
    }
}
public double u3Level;
public float u3Timer;
public float u3TimeCap;
public double u3Mult;
public double u3Power
{
    get
    {
        return 150 * u3Level * u3Mult;
    }
}
public bool u3Auto;

// Upgrade 4
public double u4Cost
{
    get
    {
        return 1406250 * Pow(1.18, u4Level);
    }
}
public double u4Level;
public float u4Timer;
public float u4TimeCap;
public double u4Mult;
public double u4Power
{
    get
    {
        return 400 * u4Level * u4Mult;
    }
}
public bool u4Auto;

// Upgrade 5
public double u5Cost
{
    get
    {
        return 105468750 * Pow(1.19, u5Level);
    }
}
public double u5Level;
public float u5Timer;
public float u5TimeCap;
public double u5Mult;
public double u5Power
{
    get
    {
        return 1000 * u5Level * u5Mult;
    }
}
public bool u5Auto;

public Data()
{
    FullReset();
}

public void FullReset()
{
    trx = 5;
    u1TimeCap = 1;
    u1Timer = 0;
    u1Mult = 1;
    trx = 5;
    u2TimeCap = 4;
    u2Timer = 0;
    u2Mult = 1;
    trx = 5;
    u3TimeCap = 15;
    u3Timer = 0;
    u3Mult = 1;
    trx = 5;
    u4TimeCap = 40;
    u4Timer = 0;
    u4Mult = 1;
    trx = 5;
    u5TimeCap = 90;
    u5Timer = 0;
    u5Mult = 1;

}

}

public class GameController : MonoBehaviour
{
public Data data;
public Text trxText;

public Text u1TitleText;
public Text u1CostText;
public Text u1ProductionText;
public Text u1PrecentText;
public Image u1Fill;

public Text u2TitleText;
public Text u2CostText;
public Text u2ProductionText;
public Text u2PrecentText;
public Image u2Fill;

public Text u3TitleText;
public Text u3CostText;
public Text u3ProductionText;
public Text u3PrecentText;
public Image u3Fill;

public Text u4TitleText;
public Text u4CostText;
public Text u4ProductionText;
public Text u4PrecentText;
public Image u4Fill;

public Text u5TitleText;
public Text u5CostText;
public Text u5ProductionText;
public Text u5PrecentText;
public Image u5Fill;

public void RunUs()
{
    RunU(1, "Knega i bruket", u1TitleText, u1CostText, u1ProductionText, u1PrecentText, u1Fill, data.u1Level, data.u1Cost, data.u1Power, data.u1Mult, ref data.u1Timer, data.u1TimeCap, data.u1Auto);
    RunU(2, "Gymma och bli stark", u2TitleText, u2CostText, u2ProductionText, u2PrecentText, u2Fill, data.u2Level, data.u2Cost, data.u2Power, data.u2Mult, ref data.u2Timer, data.u2TimeCap, data.u2Auto);
    RunU(3, "Misshandla frugan", u3TitleText, u3CostText, u3ProductionText, u3PrecentText, u3Fill, data.u3Level, data.u3Cost, data.u3Power, data.u3Mult, ref data.u3Timer, data.u3TimeCap, data.u3Auto);
    RunU(4, "Vinn runka bulle", u4TitleText, u4CostText, u4ProductionText, u4PrecentText, u4Fill, data.u4Level, data.u4Cost, data.u4Power, data.u4Mult, ref data.u4Timer, data.u4TimeCap, data.u4Auto);
    RunU(5, "Starta Indumate", u5TitleText, u5CostText, u5ProductionText, u5PrecentText, u5Fill, data.u5Level, data.u5Cost, data.u5Power, data.u5Mult, ref data.u5Timer, data.u5TimeCap, data.u5Auto);
}

public void RunU(int id, string title, Text titleT, Text costT, Text prod, Text per, Image fill, double level, double cost, double power, double mult, ref float timer, float timeCap, bool auto)
{

titleT.text = title + " - " + level;
costT.text = "UPPGRADERA" + Notation(cost) + "₿";
prod.text = Notation(power) + "₿";
per.text = (timer / timeCap * 100).ToString("F0") + "%";
fill.fillAmount = timer / timeCap;

    if (level != 0)
    if (timer < timeCap) timer += Time.deltaTime * (float)mult;
    else if (auto)
        CollectU(id);
    else
        timer = timeCap;
}

public void CollectU(int id)
{
    switch (id)
    {
        case 1:
            Collect(ref data.u1Timer, data.u1TimeCap, data.u1Power);
            break;

        case 2:
            Collect(ref data.u2Timer, data.u2TimeCap, data.u2Power);
            break;

        case 3:
            Collect(ref data.u3Timer, data.u3TimeCap, data.u3Power);
            break;

        case 4:
            Collect(ref data.u4Timer, data.u4TimeCap, data.u4Power);
            break;

        case 5:
            Collect(ref data.u5Timer, data.u5TimeCap, data.u5Power);
            break;
    }
}

public void Collect(ref float timer, float timeCap, double power)
{
            if (timer >= timeCap)
            {
                data.trx += power;
                timer = 0;
            }
}

public void BuyU(int id)
{
    switch(id)  
    {
        case 1:
            Buy(data.u1Cost, ref data.u1Level, ref data.u1Mult, ref data.u1Auto);
            break;
        case 2:
            Buy(data.u2Cost, ref data.u2Level, ref data.u2Mult, ref data.u2Auto);
            break;
        case 3:
            Buy(data.u3Cost, ref data.u3Level, ref data.u3Mult, ref data.u3Auto);
            break;
        case 4:
            Buy(data.u4Cost, ref data.u4Level, ref data.u4Mult, ref data.u4Auto);
            break;
        case 5:
            Buy(data.u5Cost, ref data.u5Level, ref data.u5Mult, ref data.u5Auto);
            break;
    }

}

public void Buy(double cost, ref double level, ref double mult, ref bool auto)
{
    if (data.trx >= cost)
    {
        data.trx -= cost;
        level += 1;
        if (level == 10)
            mult *= 2;
        if (level == 25)
            mult *= 2;
        else if (level % 50 == 0)
            mult *= 2;
        if (level == 100) auto = true;
    }
}

public void ButMaxAll()
{
    BuyMax(1058750, 1.19, ref data.u5Level);
    BuyMax(140250, 1.18, ref data.u4Level);
    BuyMax(18750, 1.17, ref data.u3Level);
    BuyMax(250, 1.16, ref data.u2Level);
    BuyMax(5, 1.15, ref data.u1Level);
}

public void BuyMax(double b, double r, ref double k)
{
    var c = data.trx;
    var n = Floor(Log(c * (r - 1) / (b * Pow(r, k)) + 1, r));

    var cost = b * (Pow(r, k) * (Pow(r, n) - 1) / (r - 1));

    if (data.trx >= cost)
    {
        k += n;
        data.trx -= cost;
    }
}

public string Notation(double x)
{
    String result;
    if (x > 1000)
    {
        var exponent = Floor(Log10(Abs(x)));
        var mantissa = x / Pow(10, exponent);
        result = mantissa.ToString("F2") + "e" + exponent;
    }
    else
        result = x.ToString("F2");
    return result;
}

public void Start()
{
    data.FullReset();
}

public void Update() 
{
    trxText.text = Notation(data.trx) + "";
    RunUs();
}

}

If what you is a save load system, then I suggest Json. Here’s an example script that saves a score:

    private void Start()
    {
        //A class with a bunch of static vars
        if(!gameManager.loaded)
            Load();
        //Checks if the curret high score is greater then the previus high score 
       //and saves it
        if (gameManager.CurHighScore > gameManager.HighScore)
            Save();
    }

    void Save()
    {
        //Creates a var of the score class created below
        Score scoreSaved = new Score
        {
            score = gameManager.CurHighScore
        };

        //Converts the scoreSaved var created above, to json
        string json = JsonUtility.ToJson(scoreSaved);

        //Saves the json to a text file called "saveScore" in the same folder
        File.WriteAllText(Application.dataPath + "/saveScore.txt", json);
        Debug.Log("SAVED");
    }
    void Load()
    { 
        //Tells the gameManager that we have loaded the high score to avoid 
        //bugs
        gameManager.loaded = true;

        //Converts the text file to Json
        string json = File.ReadAllText(Application.dataPath + "/saveScore.txt");

        //Converts the Json file to a variable of type Score
        Score scoreSaved = JsonUtility.FromJson<Score>(json);

        //Updates the gameManager's high scores
        gameManager.HighScore = scoreSaved.score;
        gameManager.CurHighScore = scoreSaved.score;

        Debug.Log("LOADED");
    }

    //The class that stores score
    //Must add System.Serializable to the class so we can save it
    [System.Serializable]
    public class Score
    {
        public int score;
    }

Make sure you add this to the top of the script so thta the game knows how to read the script

using System.IO;

And heres the gameManager:

public static class gameManager
{
    public static bool loaded = false;

    public static int score = 0;
    public static int HighScore = 0;
    public static int CurHighScore = 0;
}

I hope you can decipher this and that it is of use to you. (: