thanks for the response. The docs dont really mention what this appropriate time is but I am using it when I change the scenes or when the player quits the game.
And one thing I didnt really get yet is:
What does ES3.CacheFile(); and ES3.StoreCachedFile(); without any parameters do? Does it save all the parameters inside the cache?
If you remember I have multiple save slots each with a different path ID.
If its no problem for you could you give me an example on how to save the cache file via these 2 methods you mentioned. Even though I read the Improving Performance guide multiple times it still doesnt really work. I probably have implemented ES3.StoreCacheFile wrong but currently I just did this:
Code: Select all
public void Save()
{
Debug.Log("Save");
ES3.StoreCachedFile();
}
Code: Select all
ES3.CacheFile();
// Create an ES3Settings to load from cache.
var settings = new ES3Settings(ES3.Location.Cache);
// Load from the cached file.
var myInt = ES3.Load("myInt", 0, settings);
ES3.LoadInto("myTransform", this.transform, settings);
Code: Select all
public object LoadData(string loadKey, object defaultValue)
{
ES3.CacheFile();
var settings = new ES3Settings(ES3.Location.Cache);
return ES3.Load(loadKey, defaultValue, settings);
}
Thank you once again