예제 #1
0
    void TakingDamage()
    {
        if (!isPlayingSound)
        {
            isPlayingSound = true;
            ZombieSoundEffects _soundFX = GetComponent <ZombieSoundEffects>();
            _soundFX.PlaySound(2);
            StartCoroutine(SoundFXCooldown());
        }
        if (run)
        {
            if (canDodge && !dodging)
            {
                dodging  = true;
                canDodge = false;
                StartCoroutine(DodgeCooldown());


                if (!anim.hasRootMotion)
                {
                    anim.applyRootMotion = true;
                    anim.SetTrigger("Dodge");
                    StartCoroutine(GetAnimInfo());
                }
                else
                {
                    anim.SetTrigger("Dodge");
                }
            }
        }
    }
예제 #2
0
 void GoGrowl()
 {
     if (!isGrowling)
     {
         if (!isPlayingSound)
         {
             isGrowling = true;
             ZombieSoundEffects _soundFX = GetComponent <ZombieSoundEffects>();
             _soundFX.PlaySound(1);
             StartCoroutine(SoundFXCooldown());
         }
     }
 }
예제 #3
0
 void Attack()
 {
     attacking      = true;
     agent.velocity = Vector3.zero;
     anim.SetTrigger("Attack");
     if (hasAttackRoot)
     {
         if (!anim.hasRootMotion)
         {
             agent.updateRotation = false;
             anim.applyRootMotion = true;
             StartCoroutine(GetAnimInfo());
         }
     }
     StartCoroutine(AttackDelay());
     //StartCoroutine(AttackCooldown());
     if (!isPlayingSound)
     {
         ZombieSoundEffects _soundFX = GetComponent <ZombieSoundEffects>();
         _soundFX.PlaySound(1);
         StartCoroutine(SoundFXCooldown());
     }
 }