Exemplo 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
 }
Exemplo n.º 2
0
    private void Start()
    {
        attackRange = towerParent.collider; //Get the same collider used in the towerParent script
        //attackRange = new BoundingSphere(towerParent.transform.position, towerParent.AttackRange);

        if (towerParent != null && towerParent.TowerHasDefenders == true) //Dont move this to awake!
        {
            rallyPoint = Instantiate(rallyPointPrefab, transform.position, Quaternion.identity, towerParent.transform);
        }
        if (rallyPoint != null) //Check for null reference
        {
            //Assign reference of the scrDefenderTowerTargets script to the newly instantiated rallypoint
            scrDefenderTowerTargets     _localDefenderTowerTargets = GetComponent <scrDefenderTowerTargets>(); //Find the script on this tower
            scrTowerRallyPointDetection _newlyInstantiatedRallyPointDetectionScripot = rallyPoint.GetComponent <scrTowerRallyPointDetection>();
            _newlyInstantiatedRallyPointDetectionScripot.setReference(_localDefenderTowerTargets);             //Send it the reference

            RallyPointAPos = rallyPoint.transform.Find("PossitionA");
            RallyPointBPos = rallyPoint.transform.Find("PossitionB");
            RallyPointCPos = rallyPoint.transform.Find("PossitionC");
            //Debug.Log("Assigned rallyPoint points");
        }
    }
Exemplo n.º 3
0
 public scrDefenderTowerTargets AssignDefenderTowerTargets(scrDefenderTowerTargets _defenderTowerTargets)
 {
     DefenderTowerTargetsReference = _defenderTowerTargets; //Sets the reference for the creep
     return(defenderTowerTargets = _defenderTowerTargets);  //Gets the reference
 }
Exemplo n.º 4
0
 public scrDefenderTowerTargets setReference(scrDefenderTowerTargets _reference)
 {
     return(defenderTowerTargets = _reference);
 }