void Start() { for (int i = 0; i < prices.Length; i++) { TowerMarketInfoBase tower = Instantiate(prices[i].towerPrefab, new Vector3(-100.0f, 0.0f, 0.0f), Quaternion.identity).GetComponentInChildren <TowerMarketInfoBase>(); prices[i].price = tower.GetPrice(); prices[i].priceText.text = prices[i].price.ToString(); Destroy(tower.gameObject); } isHighlighted = false; currentTowerPrice = 0; }
public void Sell() { goldManager.ChangeGold((int)(marketScript.GetPrice() * sellingMultiplier), marketScript.transform.position); towerHolder.DeleteTower(); }