void PlaceTower() { // get x and y from FindClosest script float x = close.x + 1; float y = close.y; towerIndex = towerArray.towerIndex; GameObject newTower = Instantiate(towerArray.BuildTowers[towerIndex]); // place new tower newTower.transform.position = new Vector2(x, y); //Debug.Log("x = " + x); pT.TowerCost(); }
void PlaceTower() { // get x and y from FindClosest script float x = close.x + 1; float y = close.y; towerIndex = towerArray.towerIndex; GameObject newTower = Instantiate(towerArray.BuildTowers[towerIndex]); // place new tower newTower.transform.position = new Vector2(x, y); PlaySoundEffect(sound_wall); // pay the cost pT.TowerCost(); }