file.sync()

Discussion and help for Easy Save 3
Post Reply
BFRETHGIL
Posts: 23
Joined: Wed Jun 13, 2018 8:25 pm

file.sync()

Post 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();
}
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: file.sync()

Post 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
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply