Page 1 of 1

file.sync()

Posted: Thu Sep 30, 2021 9:23 pm
by BFRETHGIL
Hey. Where do you recommend to store file.sync()?
On OnApplicationQuit()? Any other place recommended?

The reason I'm asking is because I have a scroll view in my game, I use load and save to es3 no problem.
but everytime I run file.Sync(); it makes my scroll view to freeze (lagging), and becomes slow until the sync is done
I used to run sync after each save but I guess it's not smart.


public void OnApplicationQuit()
{
file.Sync();
}

Re: file.sync()

Posted: Fri Oct 01, 2021 7:50 am
by Joel
Hi there,

ES3File is depreciated and you should instead use the caching location documented here:
https://docs.moodkie.com/easy-save-3/es ... rformance/

To maximise the benefit from caching, you should only persist data when absolutely necessary. When is necessary very much depends on your project, but OnApplicationQuit and OnApplicationPause(true) are common places for it.

All the best,
Joel