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