Skip to content
Snippets Groups Projects
Commit 6361f3b2 authored by Nat10k's avatar Nat10k
Browse files

fix : invalid saved health load

parent e8741646
Branches
Tags
No related merge requests found
......@@ -8,6 +8,7 @@ public class Cutscene1Manager : MonoBehaviour
// Start is called before the first frame update
void OnEnable()
{
#if MOBILE_INPUT
if (PlayerPrefs.GetInt("isAR", 0) != 0)
{
SceneManager.LoadScene("AR", LoadSceneMode.Single);
......@@ -15,5 +16,8 @@ public class Cutscene1Manager : MonoBehaviour
{
SceneManager.LoadScene("Main", LoadSceneMode.Single);
}
#else
SceneManager.LoadScene("Main", LoadSceneMode.Single);
#endif
}
}
......@@ -126,12 +126,15 @@ namespace Nightmare
public void LoadData(GameData data)
{
this.currentHealth = data.playerHealth;
healthSlider.value = this.currentHealth;
if (data.playerHealth > 0)
{
this.currentHealth = data.playerHealth;
healthSlider.value = this.currentHealth;
}
}
public void SaveData(ref GameData data)
{
{
data.playerHealth = this.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