Ejemplo n.º 1
0
 void Start()
 {
     troopHealth      = GetComponent <TroopHealth>();
     troopPathFinding = GetComponent <TroopPathFinding>();
     attackTarget     = troopPathFinding.GetAttackTarget();
     troop_Info       = GetComponent <troopInfo>();
     attackType       = troop_Info.GetAttackType();
     attack_Range     = troop_Info.GetAttackRange();
     attack_Damage    = troop_Info.GetAttackDamage();
     health           = troop_Info.GetHealth();
 }
    private void Awake()
    {
        anim              = GetComponentInChildren <Animator>();
        troop_Info        = GetComponent <troopInfo>();
        seeker            = GetComponent <Seeker>();
        aiPath            = GetComponent <AIPath>();
        destinationSetter = GetComponent <AIDestinationSetter>();
        mainAttack        = GetComponent <MainAttack>();

        agroRange                 = troop_Info.cardInfo.agro_Range;
        attackRange               = troop_Info.cardInfo.attack_Range;
        aiPath.maxSpeed           = troop_Info.cardInfo.move_Speed;
        aiPath.endReachedDistance = attackRange;
        targetType                = troop_Info.cardInfo.targetType;

        isTargetingTower = true;
        isTargetingEnemy = false;
        isAttacking      = false;

        calculateTowerTarget();
    }