Example #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "player_Range")
     {
         Debug.Log("Enemy hit with projectile.");
         //Damage calculator
         damageTakenCalculator(target.returnRangeDamage());
     }
     else if (collision.gameObject.tag == "player_Melee")
     {
         Debug.Log("Enemy hit with melee.");
         //Damage calculator
         damageTakenCalculator(target.returnMeleeDamage());
     }
 }