Skip to content
Snippets Groups Projects
Commit c0275034 authored by Malik Rafsanjani's avatar Malik Rafsanjani
Browse files

fix: resolve bug on reset money

parent 8963d232
No related merge requests found
...@@ -74,6 +74,11 @@ public class GameControl : MonoBehaviour ...@@ -74,6 +74,11 @@ public class GameControl : MonoBehaviour
currency -= amt; 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 // 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) public IEnumerator StartFade(AudioSource audioSource, float duration, float targetVolume, GameObject theGameObject)
{ {
......
...@@ -48,6 +48,8 @@ public class PlayerHealth : MonoBehaviour ...@@ -48,6 +48,8 @@ public class PlayerHealth : MonoBehaviour
currentHealth = startingHealth; currentHealth = startingHealth;
} }
// reset
GameControl.control.Reset();
healthSlider.value = currentHealth; healthSlider.value = currentHealth;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment