//public float incSpeed = 2;
 // Use this for initialization
 void Start()
 {
     //at= GetComponentInParent<ArcherTower>();
     //at.GetClosestEnemy()
     enemy = ar.GetClosestTarget();
     //speed = oa.GetDmg() + incSpeed;
 }
Example #2
0
    //public float incSpeed = 2;
    // Use this for initialization
    void Start()
    {
        //at= GetComponentInParent<ArcherTower>();
        //at.GetClosestEnemy()
        AttackRanged at = from.GetComponent <AttackRanged>();

        enemy = at.GetClosestTarget();
        //speed = at.dmg + incSpeed;
    }
Example #3
0
    // Use this for initialization
    void Start()
    {
        AttackRanged at = from.GetComponent <AttackRanged>();

        enemy = at.GetClosestTarget();
        enemy.GetComponent <OrcScript>();
        int add = 0;

        if (enemy.transform.position.x < transform.position.x)
        {
            add = -xAdd;
        }
        else
        {
            add = xAdd;
        }
        lastPos = new Vector2(enemy.transform.position.x + add, enemy.transform.position.y - yAdd);
    }