If you die, you respawn

main
Matthew Kalahiki 4 years ago
parent 3bef4a7d1a
commit 56e99dac27

@ -2302,7 +2302,7 @@ MonoBehaviour:
artImage: {fileID: 430284682}
obtainedPowerups:
powerupStatus:
sceneToLoad:
sceneToLoad: BossRoom
music:
- {fileID: 8300000, guid: f29919963390ff24fa1ae468277b309e, type: 3}
--- !u!4 &637676178

@ -4,7 +4,7 @@ using UnityEngine;
public class Health : MonoBehaviour
{
public int currentHealth = 0;
public int currentHealth;
public int maxHealth = 100;
public HealthBarCustom healthBar;
@ -26,7 +26,12 @@ public class Health : MonoBehaviour
// Update is called once per frame
void Update()
{
if (currentHealth <= 0)
{
GameManager.Instance.LoadLevel("Spawn", new Vector3(0,0,0));
currentHealth = maxHealth;
healthBar.SetHealth(currentHealth);
}
}
public void DamagePlayer(int damage)

Loading…
Cancel
Save