diff --git a/Assets/Scripts/Managers/GameControl.cs b/Assets/Scripts/Managers/GameControl.cs index fd2622becc22374b1c265a266c9dcd9c8f795606..dfbe9d6843788716383ff64dab58c01288966eaa 100644 --- a/Assets/Scripts/Managers/GameControl.cs +++ b/Assets/Scripts/Managers/GameControl.cs @@ -74,6 +74,11 @@ public class GameControl : MonoBehaviour currency -= amt; } + public void Reset() + { + currency = 0; + } + // From: https://johnleonardfrench.com/how-to-fade-audio-in-unity-i-tested-every-method-this-ones-the-best public IEnumerator StartFade(AudioSource audioSource, float duration, float targetVolume, GameObject theGameObject) { diff --git a/Assets/Scripts/Player/PlayerHealth.cs b/Assets/Scripts/Player/PlayerHealth.cs index 367a65399bbe6de3e4cd7446f617934d40bf609f..eb21ca8752950cb1c784a0c1cfec8037b409bb9f 100644 --- a/Assets/Scripts/Player/PlayerHealth.cs +++ b/Assets/Scripts/Player/PlayerHealth.cs @@ -48,6 +48,8 @@ public class PlayerHealth : MonoBehaviour currentHealth = startingHealth; } + // reset + GameControl.control.Reset(); healthSlider.value = currentHealth; }