public void attackEnemy(Attack attack, float multiplier) { currentEnemyHealth -= (int)(attack.enemyDamage * multiplier); health.updateHealth(enemy.health, currentEnemyHealth); if (currentEnemyHealth <= 0) { FindObjectOfType <CombatDisplay>().playerVictory(); } }
public void updateHealth(int diff) { health += diff; health = Mathf.Min(health, maxHealth); if (health <= 0) { GameManager.instance.gameOver(false); } healthDisplay.updateHealth(maxHealth, health); }