private void OnDamageTaken() { if (damageableBehaviour.CurrentHealth <= 0) { targetableBehaviour.Disable(); } SafeEventHandler.SafelyBroadcastAction(ref DamageTaken); }
private void HandleDamageTaken() { var health = damageableBehaviour.CurrentHealth; animator.SetInteger(healthAnimatorParam, health); if (health <= 0) { autoMovementBehaviour.enabled = false; targetableBehaviour.Disable(); } }
private void HandleDamageTaken() { var health = damageableBehaviour.CurrentHealth; animator.SetInteger(healthAnimatorParam, health); if (health <= 0) { autoMovementBehaviour.enabled = false; targetableBehaviour.Disable(); audioSource.PlayOneShot(sfxDying); animator.SetTrigger("Dying"); } }
private void handleDamageTaken() { var health = damageableBehaviour.CurrentHealth; animator.SetInteger(healthAnimatorParam, health); if (health <= 0) { autoMovementBehaviour.enabled = false; targetableBehaviour.Disable(); GetComponent <CapsuleCollider2D>().enabled = false; //capsule.enabled = false; } }