Пример #1
0
 public override void Attack(TD_Enemy e)
 {
     // Enable the line
     line.enabled = true;
     // Deal damage to enemy
     e.Damage(damage);
     //
 }
Пример #2
0
    void Fire()
    {
        if (collided_objects_.Length <= 0)
        {
            return;
        }
        if (collided_objects_[0] == null)
        {
            return;
        }
        TD_Enemy target_ = collided_objects_[0].gameObject.GetComponentInParent <TD_Enemy>();

        if (!target_.isDead())
        {
            target_.Damage(damage_);
            Debug.Log(target_.GetHealth());
        }
    }