Exemple #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Bullet") && other.gameObject.layer != 13) //13 is PlayerProjectile layer
     {
         playerHealth.TakeDamage(damageToApply);
     }
 }
Exemple #2
0
 private void TakeDamage(int damage)
 {
     enemyHealth.TakeDamage(damage);
 }