Esempio n. 1
0
 private void Awake()
 {
     defenderTowerTargets = GetComponent <scrDefenderTowerTargets>();
     pooler            = GetComponent <ObjectPooler>();          //Get the instance on this tower
     rallyPointUpdater = GetComponent <scrTowerRallypointPos>(); //Get the instance
     defenders         = new List <GameObject>();                //Initialize the list
 }
Esempio n. 2
0
    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);
        }
    }
Esempio n. 3
0
 public void SetRallyPointReference(scrTowerRallypointPos _rallypointInstance)
 {
     TowerRallypointPos = _rallypointInstance;
 }