void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag(TagManager.Player) && !worm.IsRunnning()) { worm.SetTarget(other.transform); } }
void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag(TagManager.Player)) { if (PlayerManager.IsAttacking() && !worm.IsAttached() && !worm.IsStunned() && damageTimer <= 0.0f) { worm.TakeDamage(PlayerManager.CalculateDamageDone()); damageTimer = damageDelay; } else if (!PlayerManager.IsAttacking() && !worm.IsStunned() && !worm.IsRunnning()) { if (other.CompareTag(TagManager.Player)) { worm.Attach(); } } } }