private void OnTriggerEnter2D(Collider2D collision) { if (this.gameObject.activeSelf) { if (collision.GetComponent <PlayerController>() && !isPlayerBullet) { player.GetDamage(bulletDamage, Vector2.zero, 100); Destroy(this.gameObject); } if (collision.GetComponent <EnemyBehaviour>() && isPlayerBullet && !isAimPlayerBullet) { var enemy = collision.GetComponent <EnemyBehaviour>(); enemy.GetDamage(bulletDamage, enemy.transform.position, 100); Destroy(this.gameObject); if (enemy.HP <= 0) { player.AddScore(enemy.IsBoss); } player.CheckLevelUI(); } } }