// 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"); } }