Exemple #1
0
 private void OnDamageTaken()
 {
     if (damageableBehaviour.CurrentHealth <= 0)
     {
         targetableBehaviour.Disable();
     }
     SafeEventHandler.SafelyBroadcastAction(ref DamageTaken);
 }
Exemple #2
0
    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;
        }
    }