I found I was calling ES3.SaveRaw() in the my load data function that is reading a byte array (due to platform) from disk.
It's been a long time since I looked at this and don't know why I would have put a ES3.SaveRaw() in here.
Here's the suspicious code:
Code: Select all
bool successful = false;
byte[] fileAsByteArray = NXSave.Load(ref successful);
if(successful)
{
string strData = System.Text.Encoding.ASCII.GetString(fileAsByteArray);
Debug.Log(strData);
ES3.SaveRaw(fileAsByteArray, settings);
if (ES3.KeyExists("YarnVariables"))
LoadYarnVariablesFromString(ES3.Load<string>("YarnVariables"));
}
Doesn't this also write the byte array to disk?
The problem I'm running into is that ES3.KeyExists() returns false here even though it's clearly in the byte array when I print it out (no typos, etc.), so LoadYarnVariablesFromString() never gets called. Why would it be false unless it's not actually loaded into ES3? So what's the right way to load the entire array into ES3 then?
ES3.LoadRawBytes() exists, but loads the file into memory. I already have the byte array from a platform specific loading method. How do you get that into ES3?
Thanks.