public override void OnDamage(int damage, Vector2 hitPoint, Vector2 normal) { rigid.AddForce(-normal * damage * 2, ForceMode2D.Impulse); anim.SetHit(); base.OnDamage(damage, hitPoint, normal); BloodParticle bp = PoolManager.GetItem <BloodParticle>(); bp.SetRotation(normal); bp.SetParticleColor(hitColor); bp.Play(hitPoint); }
public virtual void OnDamage(int damage, Vector2 hitPoint, Vector2 normal, float power = 0) { // 피격 파티클은 여기서 재생 BloodParticle hitParticle = PoolManager.GetItem <BloodParticle>(); hitParticle.SetParticleColor(hitColor); hitParticle.SetRotation(normal); hitParticle.Play(hitPoint); currentHP -= damage; if (currentHP <= 0) { OnDie(); } }