Basically, I have two arrays, one string and one int. They are storing values and I want to be able to save and load the same values from level to level - this is for an inventory system.
When I'm not using Easy Save they work fine!
As soon as I try and load, I get nothing back and get all sorts of errors.
Here is how I'm calling it:
Code: Select all
if (ES3.KeyExists("Items Held"))
{
CharacterTracker.instance.itemsHeld = ES3.Load<string[]>("Items Held");
}
else
{
CharacterTracker.instance.itemsHeld = new string[0];
CharacterTracker.instance.itemsHeld = new string[30];
}
if (ES3.KeyExists("Number Of Items"))
{
CharacterTracker.instance.numberOfItems = ES3.Load<int[]>("Number Of Items");
}
else
{
CharacterTracker.instance.numberOfItems = new int[0];
CharacterTracker.instance.numberOfItems = new int[30];
}
If it helps (don't think it does), here's how I'm saving.
Code: Select all
ES3.Save<int[]>("Number Of Items", CharacterTracker.instance.numberOfItems);
ES3.Save<string[]>("Items Held", CharacterTracker.instance.itemsHeld);