Exemplo n.º 1
0
    private void Blow()
    {
        _explosion.Blow();
        _rb.velocity = Vector3.zero;

        Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, _detonate_radius);
        foreach (Collider2D collider in colliders)
        {
            if (collider.TryGetComponent(out Damagable component))
            {
                if (component.is_enemy != is_enemy)
                {
                    component.TakeDamage(damage);
                }
            }
        }
        HandleBlowAnimation();
    }