Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         player.TakeDamage(30);
         Destroy(gameObject);
     }
     else if (collision.CompareTag("Escort")) // One shot escort
     {
         player.DamageEscort();
         Destroy(gameObject);
         Destroy(collision.gameObject);
     }
     else if (collision.CompareTag("Bullet")) // Take damage
     {
         health--;
         Destroy(collision.gameObject);
         if (health <= 0)
         {
             Destroy(gameObject);
         }
     }
 }