void Attack() { // Reset le timer. timer = 0f; //La cible prend des dommage if (targetHealth.currentHealth > 0) { targetHealth.TakeDamage(attackDamage); } }
void Attack() { // Reset the timer. timer = 0f; // If the player has health to lose... if (playerHealth.currentHealth > 0) { // ... damage the player. playerHealth.TakeDamage(attackDamage); } }