The save appears to work (no errors); but there are problems when I try to load the item (no errors) -> just missing entries; though it retains the
structure. The entries are blank/ null/ 0 and appear to contain default values.
I think the problem may have something to do with the inability to save Collections of Collections (Dict of List). Though I'm not sure how to apply EasySaves example (of Arrays) to fix this.
I have attached two files which show my debug logs that I used to identify the problem.
Code: Select all
public Dictionary<string, List<Deck>> playerDecks = new Dictionary<string , List<Deck>>();
ES3.Save(saveStartingDeckKey, GameManager.Instance.playerDecks);
Dictionary<string, List<Deck>> savedStartDecks = ES3.Load(saveStartingDeckKey, new Dictionary<string, List<Deck>>());
Deck.DeckEntry.CardTemplate.Name (string)
Deck.DeckEntry.CardTemplate.Id (int)
The expected values are the ones in the save target. I had been able to save items that were not as nested before without any modifications.
I have attempted (without success):
- Adding CardTemplate, DeckEntry, and Deck as additional Types to be explicitly supported (via the EasySave Editor).
- Creating another public class (MonoBehaviour) "DeckList" with decks as an attribute (List<Deck>) to use in playerDecks i.e. playerDecks = new Dictionary<string , DeckList>();
- GameManager.Instance.playerDecks = Dictionary<string, List<Deck>>
- Deck is a public class with multiple classes (DeckEntry + Deck)
- DeckEntry references Cardtemplate, which is another class of type Scriptable Object.