public virtual void TakeDamage(int damage, int poiseDamage) { if (isDead) { return; } weaponSlotManager.CloseDamageCollider(); UpdateHealth(-damage); if (!isStaggered) { currentPoiseBuildUp += poiseDamage; } if (currentHealth <= 0) { animatorHandler.PlayTargetAnimation("Death 01", true); isDead = true; HandleDeath(); } else if (currentPoiseBuildUp > poise) { currentPoiseBuildUp = 0; animatorHandler.PlayTargetAnimation("Damage Light", true); isStaggered = true; } }
private void OnTriggerEnter(Collider other) { PlayerStats playerStats = other.GetComponent <PlayerStats>(); if (playerStats != null) { WeaponSlotManager weaponSlotManager = other.GetComponentInChildren <WeaponSlotManager>(); weaponSlotManager.CloseDamageCollider(); playerStats.TakeDamage(damage, 0); } }