Hello, we are facing saving issues that when the app is closed our state of the game is not saved. The problem with wsa apps is that if users close them first windows calls suspend app and then it kills it in 5s limit. Those 5s we have time to save our data. So my question is how we can use this time to save our game data? Normally all background threads from thread pools are killed immediately without notifying anyone. If one wants to get notified he needs to write BackgroundTask and call deferral.Complete()
Any solution for this saving issue? How does unity solved this problem for PlayerPrefs? Can we have source code example for that?
Thank you.
In which Unity beta version do you face this issue? Did this work in earlier versions?
Well it never worked. We actually using EasySave2 on separate saving thread. Unity faced the same problem with their PlayerPrefs but since they are synchronous it was causing us glitters in graphics. So we decided that we rewrite our own implementation of PlayerPrefs based on EasySave2. On other platforms we don’t have any issue with saving state on other thread since we can finish that thread just by setting internall terminate bool into false and thread.Join wait for that thread. But WSA does not have any thread.Join.
I would be really happy if we can find a solution how to have background saving thread that is exited correctly when app exits ( or suspend ). We can alway resume or reinit that thread OnResume. Any idea?