예제 #1
0
 public void BuyBoosters()
 {
     if (isActive)
     {
         libraryMenu.windowWarning.Show(TextStrings.GetString("booster_is_active"));
     }
     else
     {
         if (Bank.GetFreeBooster(boosterNum) > 0)
         {
             lastDateTime = System.DateTime.Now;
             PreferencesSaver.SetBoosterActivateTime(boosterNum, lastDateTime);
             Bank.MinusFreeBooster(boosterNum, 1);
         }
         else
         {
             if (BoosterValues.BoosterCost[boosterNum] > Bank.GetMoney())
             {
                 libraryMenu.windowWarning.Show(TextStrings.GetString("no_money"));
             }
             else
             {
                 lastDateTime = System.DateTime.Now;
                 PreferencesSaver.SetBoosterActivateTime(boosterNum, lastDateTime);
                 Bank.MinusMoney(BoosterValues.BoosterCost[boosterNum]);
             }
         }
     }
 }
예제 #2
0
    public void Update()
    {
        DateTime nowTime = System.DateTime.Now;

        subtractTime = nowTime.Subtract(lastDateTime);


        if (subtractTime.TotalSeconds < BoosterValues.BoosterTime[boosterNum] * 60)
        {
            UpdateTime();

            string costText = TextStrings.GetString("is_activate");

            if (!costText.Equals(cost.text))
            {
                cost.text = costText;
            }

            if (!boosterImage.sprite.Equals(activeSprite))
            {
                boosterImage.sprite = activeSprite;
                rawButton.DisableButton();
                steel.sprite = activeSteel;
            }
            isActive = true;
        }
        else
        {
            string timeText = BoosterValues.BoosterTime[boosterNum] + " " + TextStrings.GetString("minutes");

            if (!time.text.Equals(timeText))
            {
                time.text = timeText;
            }

            if (Bank.GetFreeBooster(boosterNum) > 0)
            {
                string textCost = TextStrings.GetString("free");
                if (!cost.text.Equals(textCost))
                {
                    cost.text = textCost;
                }
            }
            else
            {
                string textCost = "^ " + BoosterValues.BoosterCost[boosterNum];
                if (!cost.text.Equals(textCost))
                {
                    cost.text = textCost;
                }
            }

            if (!boosterImage.sprite.Equals(unActiveSprite))
            {
                boosterImage.sprite = unActiveSprite;
                rawButton.EnableButton();
                steel.sprite = unActiveSteel;
            }
        }
    }
예제 #3
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() + "%");
        }
    }
예제 #4
0
파일: Power.cs 프로젝트: bigstupidx/DriverX
    // Use this for initialization
    void Start()
    {
        libraryMenu = GameObject.FindObjectOfType <LibraryMenu>();

        type = int.Parse(transform.parent.name);

        //   for(int i = 0; i < 6; i++)
        //        mainSprites[i] = Resources.Load<Sprite>("Images/GUI/Menu/car_powers/car_pow_"+(i+1));

        //     for (int i = 0; i < 4; i++)
        //         secondSprites[i] = Resources.Load<Sprite>("Images/GUI/Menu/car_updates/car_update_" + i);

        button.onClick.AddListener(
            delegate
        {
            Button buttonOk             = libraryMenu.windowConfirmation.button1;
            CarParametres carParametres = libraryMenu.carChanger.GetCurrentCarParametres();
            string tempStr = "";


            switch (type)
            {
            case 1: tempStr = TextStrings.GetString("2"); break;

            case 2: tempStr = TextStrings.GetString("3"); break;

            case 3: tempStr = TextStrings.GetString("4"); break;
            }

            int upgradeCost = carParametres.GetUpgradeCost(valSecond + 1);


            buttonOk.onClick.AddListener(
                delegate
            {
                libraryMenu.windowConfirmation.Hide();

                if (upgradeCost < Bank.GetMoney())
                {
                    Bank.MinusMoney(upgradeCost);
                    AddPower();
                }
                else
                {
                    libraryMenu.windowWarning.Show(TextStrings.GetString("1") + " " + tempStr);
                }
            }
                );


            libraryMenu.windowConfirmation.Show(TextStrings.GetString("5") + " " + tempStr + " " + TextStrings.GetString("6") + " ^" + upgradeCost + ". " + TextStrings.GetString("7") + "?");
        }
            );
    }
예제 #5
0
    void SetDescription(int val1)
    {
        int padej = Padej.GetPadej(val1);

        switch (gift.type)
        {
        case Gift.GiftType.Money: description.text = "+" + val1 + " " + TextStrings.GetString("valuta");  break;

        case Gift.GiftType.Booster1: description.text = "+" + val1 + " " + TextStrings.GetString("tuning_set_" + padej); break;

        case Gift.GiftType.Booster2: description.text = "+" + val1 + " " + TextStrings.GetString("full_tank_" + padej);  break;

        case Gift.GiftType.Booster3: description.text = "+" + val1 + " " + TextStrings.GetString("additional_rates_" + padej); break;

        case Gift.GiftType.Bonus: description.text = "+" + val1 + " " + TextStrings.GetString("bonus_" + padej); break;
        }
    }
예제 #6
0
 // Use this for initialization
 public void Start()
 {
     libraryMenu      = GameObject.FindObjectOfType <LibraryMenu>();
     lastDateTime     = PreferencesSaver.GetBoosterActivateTime(boosterNum);
     description.text = TextStrings.GetString("booster_" + boosterNum + "_description");
 }
예제 #7
0
 void SetNumDay(int numDay)
 {
     this.numDay.text = numDay + " " + TextStrings.GetString("day");
 }
예제 #8
0
 void SetDescription()
 {
     description.text = TextStrings.GetString("secret_box");
 }
예제 #9
0
파일: Task.cs 프로젝트: bigstupidx/DriverX
    protected void MyActionComplete()
    {
        string str = TextStrings.GetString("done") + ": " + Description();

        library.taskHelper.ShowWinTask(str);
    }