public virtual void TakeDamage(int amount, LVector3 hitPoint) { if (isInvincible || isDead) { return; } curHealth -= amount; EntityView?.OnTakeDamage(amount, hitPoint); OnTakeDamage(amount, hitPoint); if (isDead) { OnDead(); } }
public virtual void TakeDamage(BaseEntity atker, int amount, LVector3 hitPoint) { if (isInvincible || isDead) { return; } DebugService.Trace($"{atker.EntityId} attack {EntityId} damage:{amount} hitPos:{hitPoint}"); curHealth -= amount; EntityView?.OnTakeDamage(amount, hitPoint); OnTakeDamage(amount, hitPoint); if (isDead) { OnDead(); } }