예제 #1
0
파일: Dealer.cs 프로젝트: sowa705/openchase
    // 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");
        }
    }