예제 #1
0
    public void SaveResourceAndUpgradeData()
    {
        QuickSaveWriter instWriter = QuickSaveWriter.Create(resourceAndUpgradeDataSaveFileName); //create an instance of the QuickSaveWriter

        instWriter.Write <int>("resources", Resources);
        instWriter.Write <int>("totalResources", TotalResources);
        instWriter.Write <int>("solarSystemNumber", SolarSystemNumber);
        instWriter.Write <int>("currentMaxLaserRange", currentMaxLaserRange);
        instWriter.Write <int>("currentMaxLaserRecharge", currentMaxLaserRecharge);
        instWriter.Write <int>("currentMaxRocketRange", currentMaxRocketRange);
        instWriter.Write <int>("currentMaxRocketReload", currentMaxRocketReload);
        instWriter.Write <int>("currentMaxRocketYield", currentMaxRocketYield);
        instWriter.Write <int>("currentMaxJumpRange", currentMaxJumpRange);
        instWriter.Write <int>("currentMaxJumpRecharge", currentMaxJumpRecharge);
        instWriter.Write <int>("currentMaxShieldBoost", currentMaxShieldBoost);
        instWriter.Write <bool>("currentShieldOverboostActive", currentShieldOverboostActive);
        instWriter.Write <int>("currentMaxShieldBoostRecharge", currentMaxShieldBoostRecharge);
        instWriter.Write <int>("currentMaxHealth", currentMaxHealth);
        instWriter.Write <int>("currentMaxShields", currentMaxShields);
        instWriter.Write <int>("currentMaxSensorRange", currentMaxSensorRange);

        instWriter.Write <bool>("rocketsInstalled", rocketsInstalled);
        instWriter.Write <bool>("jumpDriveInstalled", jumpDriveInstalled);
        instWriter.Write <bool>("shieldBoostInstalled", shieldBoostInstalled);

        instWriter.Write <int>("currentHealth", playerHealthControl.currentPlayerHealth);
        instWriter.Write <int>("currentShields", playerHealthControl.currentPlayerShields);
        instWriter.Write <int>("currentJumpCharge", abilityController.jumpRange);
        instWriter.Write <int>("currentLaserCharge", abilityController.laserRange);
        //Debug.Log("Laser range saved as " + abilityController.laserRange);
        instWriter.Write <int>("currentShieldBoostCharge", abilityController.currentShieldBoostCharge);
        instWriter.Write <int>("currentRocketReload", abilityController.currentRocketReloadAmount);

        instWriter.Write <int>("healthMaxUpgradeCost", HealthMaxUpgradeCost);
        instWriter.Write <int>("shieldMaxUpgradeCost", ShieldMaxUpgradeCost);
        instWriter.Write <int>("sensorRangeUpgradeCost", SensorRangeUpgradeCost);
        instWriter.Write <int>("rocketRangeUpgradeCost", RocketRangeUpgradeCost);
        instWriter.Write <int>("rocketReloadUpgradeCost", RocketReloadUpgradeCost);
        instWriter.Write <int>("rocketYieldUpgradeCost", RocketYieldUpgradeCost);
        instWriter.Write <int>("laserRangeUpgradeCost", LaserRangeUpgradeCost);
        instWriter.Write <int>("laserRechargeUpgradeCost", LaserRechargeUpgradeCost);
        instWriter.Write <int>("jumpRangeUpgradeCost", JumpRangeUpgradeCost);
        instWriter.Write <int>("jumpRechargeUpgradeCost", JumpRechargeUpgradeCost);
        instWriter.Write <int>("shieldBoostUpgradeCost", ShieldBoostUpgradeCost);
        instWriter.Write <int>("shieldBoostRechargeUpgradeCost", ShieldBoostRechargeUpgradeCost);
        instWriter.Write <int>("shieldOverboostUpgradeCost", ShieldOverboostUpgradeCost);

        instWriter.Write <float>("threatLevel", ThreatLevel);
        instWriter.Write <int>("maxThreatLevelCounter", MaxThreatLevelCounter);


        instWriter.Commit();//write the save file

        mapManager.Save();
    }