Need help - Dictionary<string, List<PlayerStatsPlus>>

Discussion and help for Easy Save 3
Post Reply
rodrigoMorales
Posts: 1
Joined: Wed Nov 17, 2021 8:43 pm

Need help - Dictionary<string, List<PlayerStatsPlus>>

Post by rodrigoMorales »

I purchased the Save solution to migrate from my old Bayat free (Unity) solution to a more complete one. However in my current project I have a class that contains my variables among them a string list dictionary, and when I send Es3.Save, it doesn't save the list information in the dictionary, it saves all of them as null.
Example:
public Dictionary<string, List<PlayerStatsPlus>> playerHolder = new Dictionary<string, List<PlayerStatsPlus>>();
Bayat save updates the information correctly, but ES3 leaves all playerHold entries null.

//playerHold is one class that contais a lot variables, is my char status of one RPG project.

Someone know how to solve this save problem?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Need help - Dictionary<string, List<PlayerStatsPlus>>

Post by Joel »

Hi there,

I have responded to your email. Just to reiterate the message I sent you:
Unfortunately it’s not possible for me to replicate this from what you’ve said. Please could you replicate this in a new project with a simple scene and send it to me with instructions?

Also be aware that unlike other solutions, Easy Save serializes fields of UnityEngine.Object reference types (such as Components/MonoBehaviours/GameObjects/ScriptableObjects) by reference, not by value. This means that if your object is generated at runtime, you should save and load it separately so that a reference exists before you try to load that reference.
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply