Exemple #1
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.CompareTag("Player"))
     {
         player.Damage(3);
     }
 }
Exemple #2
0
 private void OnTriggerEnter2D(Collider2D col)
 {
     if (col.CompareTag("Player"))
     {
         player.Damage(-3);
         Destroy(gameObject);
     }
 }