public void RemoveRangeIndicator() { if (_tower != null) { TowerUtil.ShowRange(_tower.GetComponent <TowerData>().GetActiveTower(), false); } }
void OnMouseEnter() { if (_tower == null && _selectTower.ActiveTower != null) { _previewTower = Instantiate(_selectTower.ActiveTower, transform.position, Quaternion.identity); TowerUtil.ShowRange(_previewTower.GetComponent <TowerData>().GetActiveTower(), true); } }
public void UpgradeTower() { if (CanUpgradeTower()) { TowerUtil.ShowRange(_tower.GetComponent <TowerData>().GetActiveTower(), false); _tower.GetComponent <TowerData>().increaseLevel(); _gameManager.Gold -= _tower.GetComponent <TowerData>().CurrentLevel.cost; TowerUtil.ShowRange(_tower.GetComponent <TowerData>().GetActiveTower(), true); } else { _gameManager.SetMessageLabelText("Tower is already at max level"); } }
void OnMouseUp() { if (!EventSystem.current.IsPointerOverGameObject()) { if (_tower == null) { if (CanPlaceTower()) { _tower = Instantiate(_selectTower.ActiveTower, transform.position, Quaternion.identity); _gameManager.Gold -= _tower.GetComponent <TowerData>().CurrentLevel.cost; } } else { towerHUD.ActivePlatform = gameObject; TowerUtil.ShowRange(_tower.GetComponent <TowerData>().GetActiveTower(), true); } } }