Hat remains on winner

This commit is contained in:
djkellerman
2025-04-04 12:09:40 -04:00
parent dff10176c7
commit 2976bed24c
3 changed files with 35 additions and 6 deletions

View File

@@ -74,6 +74,8 @@ public class Damageable : MonoBehaviour
public void Damage(float damage) // Adds damage to player when hit
{
if (GameManager.Instance.gameOver) return; // Prevent damage after game is over
this.damage += damage;
if (damage >= maxDamage)
{
@@ -94,7 +96,7 @@ public class Damageable : MonoBehaviour
private void Die() // Triggers death animation and sets player to dying state
{
if (GameManager.Instance != null)
if (GameManager.Instance != null && !GameManager.Instance.gameOver) // Prevent death after game is over
{
UseItem useItem = GetComponent<UseItem>();
if (useItem != null)