private void AttempToPlaceDefenderAt(Vector2 gridPos) { var coinsDisplay = FindObjectOfType <CoinsDisplay>(); int defenderCost = defender.GetGoldCost(); if (coinsDisplay.HaveEnoughCoins(defenderCost)) { SpawnDefender(gridPos); coinsDisplay.SpendCoins(defenderCost); } }
public void SetSelectedDefender(Defender defenderToSelect) { defender = defenderToSelect; defendercost = defender.GetGoldCost(); }