Esempio n. 1
0
    //------------------------------------------EXTRA LIFE----------------------------------------------------------

    private void DisplayExtraLifeCost() //If price is max, display OUT OF STOCK instead of price and disable button
    {
        if (PlayerPrefsController.GetExtraLifeCost() > extraLifeCost3)
        {
            extraLifeCostText.text = "OUT OF STOCK";
            heartButton.GetComponent <Button>().interactable = false;
        }
        else
        {
            extraLifeCostText.text = "$" + PlayerPrefsController.GetExtraLifeCost();
        }
    }
Esempio n. 2
0
 public void BuyExtraLife() //Spend the money if available, update the currency amount, increase lives, change the price
 {
     if (PlayerPrefsController.GetTotalCurrency() >= PlayerPrefsController.GetExtraLifeCost())
     {
         currency.BuyUpgrade(PlayerPrefsController.GetExtraLifeCost());
         UpdateCurrency();
         powerupsAndLives.IncreaseLives();
         NewExtraLifePrice();
     }
     else
     {
         return;
     }
 }
Esempio n. 3
0
 private void NewExtraLifePrice() //Change price based on how many times bought and saves value and updates text display
 {
     if (PlayerPrefsController.GetExtraLifeCost() == extraLifeCost0)
     {
         PlayerPrefsController.SetExtraLifeCost(extraLifeCost1);
         UpdateExtraLifeCost();
     }
     else if (PlayerPrefsController.GetExtraLifeCost() == extraLifeCost1)
     {
         PlayerPrefsController.SetExtraLifeCost(extraLifeCost2);
         UpdateExtraLifeCost();
     }
     else if (PlayerPrefsController.GetExtraLifeCost() == extraLifeCost2)
     {
         PlayerPrefsController.SetExtraLifeCost(extraLifeCost3);
         UpdateExtraLifeCost();
     }
     else if (PlayerPrefsController.GetExtraLifeCost() >= extraLifeCost3)
     {
         PlayerPrefsController.SetExtraLifeCost(extraLifeCost3 + 1);
         heartButton.GetComponent <Button>().interactable = false;
         extraLifeCostText.text = "OUT OF STOCK";
     }
 }