private void OnTriggerEnter2D(Collider2D other) { explosion.start(); screenShake.shake(shakeAmount, shakeDuration); Instantiate(explosionEffect, transform.position, explosionEffect.transform.rotation); Destroy(gameObject); }
private void OnTriggerEnter2D(Collider2D other) { if (!isActive || !other.CompareTag("Enemy")) { return; } explosion.start(); screenShake.shake(shakeAmount, shakeDuration); Instantiate(explosionEffect, transform.position, explosionEffect.transform.rotation); Destroy(gameObject); }