::
Ah, this is due an intentional error. We did not include code for checking the player’s max health when creating the series, thus, on every reload, it will default to the set max health of [5] in the inspector.
To solve this issue, simply go to your SaveData.cs:
//player stuff
public int playerMaxHealth;
public void SavePlayerData()
{
using (BinaryWriter writer = new BinaryWriter(File.OpenWrite(Application.persistentDataPath + "/save.player.data")))
{
playerMaxHealth = PlayerController.Instance.maxHealth;
writer.Write(playerMaxHealth);
}
}
public void LoadPlayerData()
{
if (File.Exists(Application.persistentDataPath + "/save.player.data"))
{
using (BinaryReader reader = new BinaryReader(File.OpenRead(Application.persistentDataPath + "/save.player.data")))
{
playerMaxHealth = reader.ReadInt32();
}
}
}