Hi,
Is there a way to catch crashes before the application totally becomes dead in script ? So we can store final game data ( player prefs ) before application goes totally dead ?
Regards.
Hi,
Is there a way to catch crashes before the application totally becomes dead in script ? So we can store final game data ( player prefs ) before application goes totally dead ?
Regards.
Not that I can think of, nor would I expect an app to do that - even AAA games lose your progress since last save when they crash. Have you considered a periodic autosave feature to minimize data loss instead?
In my own game, I use JSON serialization and a save feature which triggers on the app closing or going into the background, but even under these conditions save game data is not written when the app is closed as a result of a crash.
No. Unity does some stuff for analytics, but that stuff happens outside of the app(you’re not making a call for the crash report). Once your app crashes, you’re not running code anymore. There isn’t a “almost dead” state for a crash.
@GeorgeCH_1 has the right idea. Autosave if possible for the player. Crashes themselves aren’t expected to save data, so your best bet is to try your best to reduce the number of crashes that occur.
I see, thanks for info guys…