void Update() { // If health is less than or equal to 0... if (_health <= 0f) { // Otherwise, if the player is dead, call the PlayerDead and LevelReset functions. PlayerDead(); LevelReset(); } }
// Update is called once per frame void Update() { health.Update(); if (health.Dead()) { playerAlive = false; deathReason = "You got mauled by a zombie!"; } }