Пример #1
0
 public void BuyMissle()
 {
     if (currency.AttemptPurchase(stockpile.GetCost()))
     {
         stockpile.Buy();
         planetMissleCost.text = stockpile.GetCost().ToString();
     }
     else
     {
         Notifications.Instance.DisplayNotification("Not Enough Money");
     }
 }
Пример #2
0
    IEnumerator BuyWeapon()
    {
        int rand = UnityEngine.Random.Range(0, purchasables.Length);

        IPurchasable weapon = purchasables[rand];

        if (aiCurrency.AttemptPurchase(weapon.GetCost()))
        {
            weapon.Buy();
        }

        yield return(new WaitForSeconds(8f));

        StartCoroutine("BuyWeapon");
    }
Пример #3
0
 public bool Buy(Currency currency)
 {
     if (currency.AttemptPurchase(GetCost()))
     {
         photonView.RPC("SpawnInterceptor", PhotonTargets.AllBuffered, photonView.viewID);
         isAlive = true;
         return(true);
     }
     return(false);
 }
Пример #4
0
    public void UpgradeStat(int statIndex)
    {
        StatType _statType = (StatType)statIndex;

        foreach (Stat stat in stats)
        {
            if (_statType == stat.statType)
            {
                if (currency.AttemptPurchase(stat.GetCost()))
                {
                    stat.IncreaseStat();
                    //stat.IncreaseStat();
                    SetCostText(stat);
                }
                else
                {
                    Notifications.Instance.DisplayNotification("Not Enough Money");
                }
            }
        }
    }