Esempio n. 1
0
    protected override void OnClick()
    {
        CarParametres carParametres = libraryMenu.carChanger.GetCurrentCarParametres();

        if (carParametres.GetCost() > Bank.GetMoney())
        {
            libraryMenu.windowWarning.Show(TextStrings.GetString("no_money") + " " + carParametres.GetName());
        }
        else
        {
            Button buttonOk = libraryMenu.windowConfirmation.button1;
            buttonOk.onClick.AddListener(
                delegate
            {
                libraryMenu.windowConfirmation.Hide();

                Bank.MinusMoney(carParametres.GetCost());
                PreferencesSaver.OpenCar(carParametres.GetNumCar());

                libraryMenu.carChanger.ShowCar();
            }
                );
            libraryMenu.windowConfirmation.Show("Вы уверены, что хотите купить " + carParametres.GetName() + " за " + carParametres.GetCost() + "%");
        }
    }
Esempio n. 2
0
    void NextCar()
    {
        int numCar = carParametres.GetNumCar();

        numCar++;
        foreach (Transform child in car.transform)
        {
            Destroy(child.gameObject);
        }

        if (carParametres != null)
        {
            StartCoroutine(CreateCar(numCar));
        }



        UpdateDisableButton();
    }