예제 #1
0
 public void RemoveRangeIndicator()
 {
     if (_tower != null)
     {
         TowerUtil.ShowRange(_tower.GetComponent <TowerData>().GetActiveTower(), false);
     }
 }
예제 #2
0
 void OnMouseEnter()
 {
     if (_tower == null && _selectTower.ActiveTower != null)
     {
         _previewTower = Instantiate(_selectTower.ActiveTower, transform.position, Quaternion.identity);
         TowerUtil.ShowRange(_previewTower.GetComponent <TowerData>().GetActiveTower(), true);
     }
 }
예제 #3
0
 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");
     }
 }
예제 #4
0
 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);
         }
     }
 }