예제 #1
0
 private void OnDamageTaken()
 {
     if (damageableBehaviour.CurrentHealth <= 0)
     {
         targetableBehaviour.Disable();
     }
     SafeEventHandler.SafelyBroadcastAction(ref DamageTaken);
 }
예제 #2
0
    private void HandleDamageTaken()
    {
        var health = damageableBehaviour.CurrentHealth;

        animator.SetInteger(healthAnimatorParam, health);
        if (health <= 0)
        {
            autoMovementBehaviour.enabled = false;
            targetableBehaviour.Disable();
        }
    }
예제 #3
0
    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;
        }
    }