Example #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Collectable")
     {
         collectionController.Collect(collision.gameObject, false);
     }
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "InnerBorder")
     {
         playerHealth.DestroyShip();
     }
     else if (collision.gameObject.tag == "EnemyCollider")
     {
         playerHealth.TakeDamage();
     }
     else if (collision.gameObject.tag == "Collectable")
     {
         collectionController.Collect(collision.gameObject);
     }
 }