Change OnApplicationQuit to OnDestroy in EOSManager.cs #840
Replies: 1 comment 4 replies
-
That's really interesting, thank you for sharing! I didn't know about this facet of Unity. I'll talk about the implementation and get this in to our internal task tracking software. There is a boolean that stops it from attempting to shutdown. The Part of the reason not to do OnDestroy was because it should only ever shutdown once, during the lifetime of the application. If a user doesn't mark the EOSManager as DontDestroyOnLoad, then it might be destroyed as the user transitions between scenes. But as you have demonstrated here, this still isn't a fool-proof solution. Looking further at |
Beta Was this translation helpful? Give feedback.
-
Hi,
I would like to propose changing OnApplicationQuit to OnDestroy in EOSManager. Mainly because OnApplicationQuit can be called and the application can keep running for example if you override https://docs.unity3d.com/ScriptReference/Application-wantsToQuit.html
This would be similar to how SteamManager performs shutting down the native side.
You can test how this works by preventing application shutdown with:
Application.wantsToQuit += () => { return false; };
and put a MonoBehaviour with:
OnApplicationQuit() Debug.Log("Quit Attempted")
Then press the X on the window to attempt to quit.
I do know there is a boolean where I can stop this behaviour from happening, but it might be better for this to be the default.
Beta Was this translation helpful? Give feedback.
All reactions