IEnumerator Attackpeudevie()
{
Anim.Play("Attack_02");
// Reset the timer.
timer = 0f;
jouelaniamtiondattaque = true;
yield return new WaitForSeconds(0.6f);
timer = 0f;
// Première partie de l'anim
if (playerHealth.currentHealth > 0&&enemyHealth.currentHealth>0)
{
// ... damage the player.
playerHealth = target.GetComponent<PlayerHealth>();
playerHealth.TakeDamage(attackDamage/3);
}
yield return new WaitForSeconds(1.4f);
timer = 0f;
// Seconde partie de l'anim
if (playerHealth.currentHealth > 0&&enemyHealth.currentHealth>0)
{
// ... damage the player.
playerHealth = target.GetComponent<PlayerHealth>();
playerHealth.TakeDamage(attackDamage / 3);
}
jouelaniamtiondattaque = false;
}