public void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "Enemy") { Destroy(gameObject); GameObject Target = collider.gameObject; HealthManageer healthManageer = Target.GetComponent <HealthManageer>(); healthManageer.GetDamage(damage); } }
public void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "Enemy") { anim.SetBool("HasToCollide", true); GameObject Target = collider.gameObject; HealthManageer healthManageer = Target.GetComponent <HealthManageer>(); healthManageer.GetDamage(damage); } }
public void DealDamage(float damage) { if (Target) { HealthManageer healthManageer = Target.GetComponent <HealthManageer>(); if (healthManageer.health > 0) { healthManageer.GetDamage(damage); } else { anim.SetBool("HasToAttack", false); } } }
public void DealDamage(float damage) { if (Target) { healthManageer = Target.GetComponent <HealthManageer>(); if (healthManageer.health > 0) { if (Target.tag == "Hero") { healthManageer.GetDamage(damage); } } else { anim.SetBool("HasToAttackNNoWalk", false); anim.SetBool("HasToWalk", true); } } }