Exemplo n.º 1
0
    public virtual void OnTriggerEnter2D(Collider2D collider)
    {
        AbstractClass ac = collider.GetComponent <AbstractClass> ();

        if (ac)
        {
            ac.damage(damage, AbstractDamageCollider.DamageType.light, knockback);
            destroy();
        }
    }
Exemplo n.º 2
0
 public void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.gameObject == _target && collider.tag != "AllyHazard")
     {
         // Only damage the target.
         AbstractClass ac = collider.GetComponent <AbstractClass> ();
         if (ac)
         {
             ac.damage(_damage, AbstractDamageCollider.DamageType.medium, _knockback);
             _anim.SetTrigger("Die");
             parrotState = ParrotState.die;
         }
     }
 }