Failing to load List within a Dictionary<string, object>
Posted: Sun May 01, 2022 4:31 pm
Hello!
I started trying to save using generic objects, and when I'm saving a Dictionary<string, object>, and I'm adding a List as an object it fails as. So far, I'm not having issues with any other type, but only Lists (I have not tried any other collections). I'm using Version 3.4.2 on Unity 2021.3.0f1.
Basically:
Result: FormatException: Expected '{' or "null", found '['.
I saw the same issue here but the poster did not follow through https://moodkie.com/forum/viewtopic.php?p=9529#p9529.
Is there anything that you think I can to overcome this?
Thank you in advance!
I started trying to save using generic objects, and when I'm saving a Dictionary<string, object>, and I'm adding a List as an object it fails as
Code: Select all
FormatException: Expected '{' or "null", found '['.
Basically:
Code: Select all
List<string> thisIsAList = new List<string> { "One", "Two" };
Dictionary<string, object> references = new Dictionary<string, object>();
public void SomeSaveMethod()
{
references.Add("List", thisIsAList);
ES3.Save("References", references);
}
public void SomeLoadMethod()
{
references = ES3.Load<Dictionary<string, object>>("References");
thisIsAList = (List<string>)references["List"];
}
I saw the same issue here but the poster did not follow through https://moodkie.com/forum/viewtopic.php?p=9529#p9529.
Is there anything that you think I can to overcome this?
Thank you in advance!