Loading ScriptablesObjects returns null
Posted: Sun Jul 10, 2022 3:58 pm
Save function:
Makes this save file:
Load function:
I go into play mode, set the savedItem as the 'red key' scriptable object. Then exit and re-enter play mode. When I use the load function, it returns a null scriptable object
Code: Select all
public void Save()
{
ES3.DeleteFile("Cache");
ES3.Save("savedItem", savedItem, "tests", new ES3Settings(ES3.Location.Cache));
ES3.StoreCachedFile("tests");
}
Code: Select all
{
"savedItem" : {
"__type" : "InventoryItemSO,Assembly-CSharp",
"value" : {
"_ES3Ref" : "15922733832865706",
"_ES3Ref" : "15922733832865706"
}
}
}
Code: Select all
public void Load()
{
ES3.CacheFile("tests");
savedItem = ES3.Load("savedItem", "tests", SOLibrary.instance.item_Key_Blue, new ES3Settings(ES3.Location.Cache));
}