public void BuyMissle() { if (currency.AttemptPurchase(stockpile.GetCost())) { stockpile.Buy(); planetMissleCost.text = stockpile.GetCost().ToString(); } else { Notifications.Instance.DisplayNotification("Not Enough Money"); } }
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"); }
public bool Buy(Currency currency) { if (currency.AttemptPurchase(GetCost())) { photonView.RPC("SpawnInterceptor", PhotonTargets.AllBuffered, photonView.viewID); isAlive = true; return(true); } return(false); }
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"); } } } }