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"); } } } }
void GoGrowl() { if (!isGrowling) { if (!isPlayingSound) { isGrowling = true; ZombieSoundEffects _soundFX = GetComponent <ZombieSoundEffects>(); _soundFX.PlaySound(1); StartCoroutine(SoundFXCooldown()); } } }
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()); } }