public void ToggleRangeSpriteOff(scrTowerTargeting _reference) //Turn the rangeSprite off if this is not the tower clicked on { if (this != _reference) { rangeSprite.SetActive(false); } }
public void ToggleRangeSpriteOn(scrTowerTargeting _reference) //Turn the rangeSprite on if this is the tower clicked on { if (this != _reference) { return; } rangeSprite.SetActive(true); }
private void Start() { assignedStats.ResetStats(); Tower = GetComponent <scrTowerTargeting>(); //IMPORTANT: Other scripts will acess the properties in stats. They do not need to run this method, HOWEVER, they cannot acces //the stats in AWAKE. Instead, do it in START. This is done to make sure that the stats are initialized before they are called, as other classes AWAKE //might run before this one. //Assign stats delayBetweenAttacks = assignedStats.DelayBetweenAttacks; Damage = assignedStats.ProjectileDamage; LoadProjectile(); }
private void PlaceTower(scrTowerSettings towerLoaded) { if (_currentNodeSelected != null) { GameObject towerInstance = Instantiate(towerLoaded.TowerPrefab); //Get tower from tower pool instead towerInstance.transform.localPosition = _currentNodeSelected.transform.position; towerInstance.transform.parent = _currentNodeSelected.transform; scrTowerTargeting towerPlaced = towerInstance.GetComponent <scrTowerTargeting>(); scrTowerPrefabTracker towerPlacedLevelTracker = towerInstance.GetComponent <scrTowerPrefabTracker>(); scrTowerRallypointPos towerPlacedRallyPointPos = towerInstance.GetComponent <scrTowerRallypointPos>(); _currentNodeSelected.SetRallyPointReference(towerPlacedRallyPointPos); _currentNodeSelected.SetTower(towerPlaced); _currentNodeSelected.SetTowerLevelTracker(towerPlacedLevelTracker); } }
public void SetCurrentTowerSelected(scrTowerTargeting _tower) { CurrentTowerSelected = _tower; }
public void SetTower(scrTowerTargeting tower) //This is called by the scrTowerShopManager in the PlaceTower() event { Tower = tower; }
private void Awake() { towerParent = GetComponent <scrTowerTargeting>(); }