// Update is called once per frame public void Save() { SaveSystem.SaveObject.SettingsData.ResolutionScaling = ResolutionScaling.value; SaveSystem.SaveObject.SettingsData.EnableAudio = Audio.value == 1; SaveSystem.SaveObject.SettingsData.HQReflections = DynamicReflections.value; SaveSystem.SaveObject.SettingsData.LensBlur = LensBlur.value; SaveSystem.SaveObject.SettingsData.MotionBlur = MotionBlur.value; SaveSystem.SaveObject.SettingsData.ShadowQuality = ShadowQuality.value; SaveSystem.SaveObject.SettingsData.AntiAliasing = AntiAliasing.value; SaveSystem.SaveObject.SettingsData.AmbientOcclusion = AmbientOcclusion.value; SaveSystem.SaveObject.SettingsData.ChromaticAberration = ChromaticAbberation.value; SaveSystem.SaveObject.SettingsData.UIScale = UIScale.value; SaveSystem.SaveObject.SettingsData.ShowFPS = ShowFPS.value == 1; SaveSystem.AddLog(new Save.LogEntry("Settings", "Saved user settings")); switch (ShadowQuality.value) { case 0: QualitySettings.shadowResolution = ShadowResolution.Low; break; case 1: QualitySettings.shadowResolution = ShadowResolution.Medium; break; case 2: QualitySettings.shadowResolution = ShadowResolution.High; break; default: break; } SaveSystem.SaveData(); }
public void BuyButton() { if (CalculatePrice() <= SaveSystem.GetCash()) { SaveSystem.AddCash(-CalculatePrice()); SaveSystem.AddLog(new Save.LogEntry("ModEditor", $"Bought parts for {target.Name}, $ {CalculatePrice()}")); GarageManager.instance.SaveEditedVehicleWithoutExiting(); BuyMenu.SetActive(false); } }
public void SaveEditedVehicle() { GarageRotater.FOV = 60; SaveSystem.UpdateVehicleParts(Editor.target.GetInstalledParts(), SaveSystem.GetSelectedVehicleIndex()); SaveSystem.AddLog(new Save.LogEntry("GarageManager", $"Updated vehicle parts {Editor.target.Name}")); state = GarageState.Garage; Editor.gameObject.SetActive(false); GarageView.gameObject.SetActive(true); VehicleView.gameObject.SetActive(true); ScheduledJob = 5; }
// Update is called once per frame void OnEnable() { switch (GameManager.gm.player.reason) { case DeathReason.Rammed: Reason.text = "You have been rammed by police"; break; case DeathReason.Fall: Reason.text = "You fell out of map"; break; case DeathReason.Crash: Reason.text = "You crashed"; break; case DeathReason.Caught: Reason.text = "You have been caught by police"; break; default: break; } highscore = SaveSystem.GetHighscore(HardMode.Mode); Points.text = GameManager.gm.player.Points.ToString(); if (((int)GameManager.gm.player.Points) > highscore) { highscore = (int)GameManager.gm.player.Points; SaveSystem.SetHighscore(highscore, HardMode.Mode); SaveSystem.AddLog(new Save.LogEntry("EndScreen", $"New highscore Hardmode={HardMode.Mode}, {highscore} pts")); Highscore.text = $"New highscore: {highscore}"; } else { Highscore.text = $"Highscore: {highscore}"; } if (HardMode.Mode) { Cash.text = $"{(int)GameManager.gm.player.Points /10} $"; SaveSystem.AddCash((int)GameManager.gm.player.Points / 10); SaveSystem.AddLog(new Save.LogEntry("EndScreen", $"Added cash: $ {(int)GameManager.gm.player.Points / 10}")); } else { Cash.text = $"{(int)GameManager.gm.player.Points / 20} $"; SaveSystem.AddCash((int)GameManager.gm.player.Points / 20); SaveSystem.AddLog(new Save.LogEntry("EndScreen", $"Added cash: $ {(int)GameManager.gm.player.Points / 20}")); } }
// Update is called once per frame public void BuyButton() { VehicleInfo vehicle = vehicleInfoList[view.SelectedIndex]; if (SaveSystem.GetCash() >= vehicle.Price) { Save.Vehicle v = vehicle.GetSaveVehicle(); SaveSystem.AddVehicle(v); SaveSystem.AddCash(-vehicle.Price); SaveSystem.AddLog(new Save.LogEntry("Dealer", $"Added car {v.Type}")); SaveSystem.SetSelectedVehicleIndex(SaveSystem.GetVehicles().Count - 1); GarageManager.instance.CloseDealerMenu(); } else { Debug.Log("git gud fagit"); } }
public void SaveEditedVehicleWithoutExiting() { SaveSystem.UpdateVehicleParts(Editor.target.GetInstalledParts(), SaveSystem.GetSelectedVehicleIndex()); SaveSystem.AddLog(new Save.LogEntry("GarageManager", $"Updated vehicle parts {Editor.target.Name} without exiting")); }