public void LoadCosts()
    {
        if (File.Exists(Application.persistentDataPath + "/CostAndPricesData.4thId"))
        {
            BinaryFormatter   cap  = new BinaryFormatter();
            FileStream        file = File.Open(Application.persistentDataPath + "/CostAndPricesData.4thId", FileMode.Open);
            CostAndPricesData data = (CostAndPricesData)cap.Deserialize(file);
            file.Close();


            // Assault Team
            //Cost Buy / Upgrade Warfunds or Gold
            //Guard to Mechanized infantry
            BuyGuardWarfunds          = data._BuyGuardWarfunds;
            BuyGuardGold              = data._BuyGuardGold;
            UpgradeToMotorGuardWF     = data._UpgradeToMotorGuardWF;
            UgradeToMotorGuardGold    = data._UgradeToMotorGuardGold;
            UgradeToInfantryWF        = data._UgradeToInfantryWF;
            UgradeToInfantryGold      = data._UgradeToInfantryGold;
            UgradeToMotorInfantryWF   = data._UgradeToMotorInfantryWF;
            UgradeToMotorInfantryGold = data._UgradeToMotorInfantryGold;
            UgradeToMechInfantryWF    = data._UgradeToMechInfantryWF;
            UgradeToMechInfantryGold  = data._UgradeToMechInfantryGold;

            //Recon
            BuyReconWarfunds           = data._BuyReconWarfunds;
            BuyReconGold               = data._BuyReconGold;
            UgradeToMotorReconWarfunds = data._UgradeToMotorReconWarfunds;
            UgradeToMotorReconGold     = data._UgradeToMotorReconGold;
            UgradeToMechReconWarfunds  = data._UgradeToMechReconWarfunds;
            UgradeToMechReconGold      = data._UgradeToMechReconGold;

            //Para
            BuyPathfinderWarfunds   = data._BuyPathfinderWarfunds;
            BuyPathfinderGold       = data._BuyPathfinderGold;
            UgradeToParatrooperWF   = data._UgradeToParatrooperWF;
            UgradeToParatrooperGold = data._UgradeToParatrooperGold;

            //Light to Heavy armor
            BuyLightArmorWarfunds     = data._BuyLightArmorWarfunds;
            BuyPLightArmorGold        = data._BuyPLightArmorGold;
            UgradeToMediumArmorWF     = data._UgradeToMediumArmorWF;
            UgradeToMediumArmorGold   = data._UgradeToMediumArmorGold;
            UgradeToHeavyArmorWF      = data._UgradeToHeavyArmorWF;
            UgradeToHeavyArmorGold    = data._UgradeToHeavyArmorGold;
            UgradeToTankDestroyerWF   = data._UgradeToTankDestroyerWF;
            UgradeToTankDestroyerGold = data._UgradeToTankDestroyerGold;

            //Fighter to fighters
            BuyReconFighterWarfunds        = data._BuyReconFighterWarfunds;
            BuyReconFighterGold            = data._BuyReconFighterGold;
            UgradeToMediumFightersWarfunds = data._UgradeToMediumFightersWarfunds;
            UgradeToMediumFighterGold      = data._UgradeToMediumFighterGold;
            UgradeToHeavyFighterWarfunds   = data._UgradeToHeavyFighterWarfunds;
            UgradeToHeavyFighterGold       = data._UgradeToHeavyFighterGold;

            //Total Reinforce cost warfunds or gold
            //Guard to Mechanized infantry
            ReinfGuardWarfunds      = data._ReinfGuardWarfunds;
            ReinfGuardGold          = data._ReinfGuardGold;
            ReinfMotorGuardWF       = data._ReinfMotorGuardWF;
            ReinfMotorGuardGold     = data._ReinfMotorGuardGold;
            ReinfInfantryWF         = data._ReinfInfantryWF;
            ReinfInfantryGold       = data._ReinfInfantryGold;
            ReinfMotorInfantryWF    = data._ReinfMotorInfantryWF;
            ReinfMotorInfantryGold  = data._ReinfMotorInfantryGold;
            ReinfoMechInfantryWF    = data._ReinfoMechInfantryWF;
            ReinfReconWarfunds      = data._ReinfReconWarfunds;
            ReinfReconGold          = data._ReinfReconGold;
            ReinfMotorReconWarfunds = data._ReinfMotorReconWarfunds;
            ReinfMotorReconGold     = data._ReinfMotorReconGold;
            ReinfMechReconWarfunds  = data._ReinfMechReconWarfunds;
            ReinfMechReconGold      = data._ReinfMechReconGold;

            //Para
            ReinfathfinderWarfunds = data._ReinfathfinderWarfunds;
            ReinfPathfinderGold    = data._ReinfPathfinderGold;
            ReinfParatrooperWF     = data._ReinfParatrooperWF;
            ReinfParatrooperGold   = data._ReinfParatrooperGold;

            //Light to Heavy armor
            ReinfLightArmorWarfunds = data._ReinfLightArmorWarfunds;
            ReinfPLightArmorGold    = data._ReinfPLightArmorGold;
            ReinfMediumArmorWF      = data._ReinfMediumArmorWF;
            ReinfMediumArmorGold    = data._ReinfMediumArmorGold;
            ReinfHeavyArmorWF       = data._ReinfMediumArmorGold;
            ReinfHeavyArmorGold     = data._ReinfHeavyArmorGold;
            ReinfTankDestroyerWF    = data._ReinfTankDestroyerWF;
            ReinfTankDestroyerGold  = data._ReinfTankDestroyerGold;

            //Fighter to fighters
            ReinfReconFighterWarfunds   = data._ReinfReconFighterWarfunds;
            ReinfReconFighterGold       = data._ReinfReconFighterGold;
            ReinfMediumFightersWarfunds = data._ReinfMediumFightersWarfunds;
            ReinfMediumFighterGold      = data._ReinfMediumFighterGold;
            ReinfHeavyFighterWarfunds   = data._ReinfHeavyFighterWarfunds;
            ReinfHeavyFighterGold       = data._ReinfHeavyFighterGold;
        }
    }
    public void SaveCosts()
    {
        BinaryFormatter cap  = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/CostAndPricesData.4thId");

        CostAndPricesData data = new CostAndPricesData();

        // Assault Team
        //Cost Buy / Upgrade Warfunds or Gold
        //Guard to Mechanized infantry
        data._BuyGuardWarfunds          = BuyGuardWarfunds;
        data._BuyGuardGold              = BuyGuardGold;
        data._UpgradeToMotorGuardWF     = UpgradeToMotorGuardWF;
        data._UgradeToMotorGuardGold    = UgradeToMotorGuardGold;
        data._UgradeToInfantryWF        = UgradeToInfantryWF;
        data._UgradeToInfantryGold      = UgradeToInfantryGold;
        data._UgradeToMotorInfantryWF   = UgradeToMotorInfantryWF;
        data._UgradeToMotorInfantryGold = UgradeToMotorInfantryGold;
        data._UgradeToMechInfantryWF    = UgradeToMechInfantryWF;
        data._UgradeToMechInfantryGold  = UgradeToMechInfantryGold;

        //Recon
        data._BuyReconWarfunds           = BuyReconWarfunds;
        data._BuyReconGold               = BuyReconGold;
        data._UgradeToMotorReconWarfunds = UgradeToMotorReconWarfunds;
        data._UgradeToMotorReconGold     = UgradeToMotorReconGold;
        data._UgradeToMechReconWarfunds  = UgradeToMechReconWarfunds;
        data._UgradeToMechReconGold      = UgradeToMechReconGold;

        //Para
        data._BuyPathfinderWarfunds   = BuyPathfinderWarfunds;
        data._BuyPathfinderGold       = BuyPathfinderGold;
        data._UgradeToParatrooperWF   = UgradeToParatrooperWF;
        data._UgradeToParatrooperGold = UgradeToParatrooperGold;

        //Light to Heavy armor
        data._BuyLightArmorWarfunds     = BuyLightArmorWarfunds;
        data._BuyPLightArmorGold        = BuyPLightArmorGold;
        data._UgradeToMediumArmorWF     = UgradeToMediumArmorWF;
        data._UgradeToMediumArmorGold   = UgradeToMediumArmorGold;
        data._UgradeToHeavyArmorWF      = UgradeToHeavyArmorWF;
        data._UgradeToHeavyArmorGold    = UgradeToHeavyArmorGold;
        data._UgradeToTankDestroyerWF   = UgradeToTankDestroyerWF;
        data._UgradeToTankDestroyerGold = UgradeToTankDestroyerGold;

        //Fighter to fighters
        data._BuyReconFighterWarfunds        = BuyReconFighterWarfunds;
        data._BuyReconFighterGold            = BuyReconFighterGold;
        data._UgradeToMediumFightersWarfunds = UgradeToMediumFightersWarfunds;
        data._UgradeToMediumFighterGold      = UgradeToMediumFighterGold;
        data._UgradeToHeavyFighterWarfunds   = UgradeToHeavyFighterWarfunds;
        data._UgradeToHeavyFighterGold       = UgradeToHeavyFighterGold;

        //Total Reinforce cost warfunds or gold
        //Guard to Mechanized infantry
        data._ReinfGuardWarfunds     = ReinfGuardWarfunds;
        data._ReinfGuardGold         = ReinfGuardGold;
        data._ReinfMotorGuardWF      = ReinfMotorGuardWF;
        data._ReinfMotorGuardGold    = ReinfMotorGuardGold;
        data._ReinfInfantryWF        = ReinfInfantryWF;
        data._ReinfInfantryGold      = ReinfInfantryGold;
        data._ReinfMotorInfantryWF   = ReinfMotorInfantryWF;
        data._ReinfMotorInfantryGold = ReinfMotorInfantryGold;
        data._ReinfoMechInfantryWF   = ReinfoMechInfantryWF;
        data._ReinfMechInfantryGold  = ReinfMechInfantryGold;

        //Recon
        data._ReinfReconWarfunds      = ReinfReconWarfunds;
        data._ReinfReconGold          = ReinfReconGold;
        data._ReinfMotorReconWarfunds = ReinfMotorReconWarfunds;
        data._ReinfMotorReconGold     = ReinfMotorReconGold;
        data._ReinfMechReconWarfunds  = ReinfMechReconWarfunds;
        data._ReinfMechReconGold      = ReinfMechReconGold;

        //Para
        data._ReinfathfinderWarfunds = ReinfathfinderWarfunds;
        data._ReinfPathfinderGold    = ReinfPathfinderGold;
        data._ReinfParatrooperWF     = ReinfParatrooperWF;
        data._ReinfParatrooperGold   = ReinfParatrooperGold;

        //Light to Heavy armor
        data._ReinfLightArmorWarfunds = ReinfLightArmorWarfunds;
        data._ReinfPLightArmorGold    = ReinfPLightArmorGold;
        data._ReinfMediumArmorWF      = ReinfMediumArmorWF;
        data._ReinfMediumArmorGold    = ReinfMediumArmorGold;
        data._ReinfHeavyArmorWF       = ReinfHeavyArmorWF;
        data._ReinfHeavyArmorGold     = ReinfHeavyArmorGold;
        data._ReinfTankDestroyerWF    = ReinfTankDestroyerWF;
        data._ReinfTankDestroyerGold  = ReinfTankDestroyerGold;

        //Fighter to fighters
        data._ReinfReconFighterWarfunds   = ReinfReconFighterWarfunds;
        data._ReinfReconFighterGold       = ReinfReconFighterGold;
        data._ReinfMediumFightersWarfunds = ReinfMediumFightersWarfunds;
        data._ReinfMediumFighterGold      = ReinfMediumFighterGold;
        data._ReinfHeavyFighterWarfunds   = ReinfHeavyFighterWarfunds;
        data._ReinfHeavyFighterGold       = ReinfHeavyFighterGold;


        cap.Serialize(file, data);
        file.Close();
    }