private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "enemy") { hp.Damage(10); } }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "enemy" && !hitflag) { hp.Damage(10); hppoint -= 10; OnHitEffect(); } }