You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// <summary>Unity [OnApplicationQuit](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationQuit.html) is called before the application quits.
/// <summary>Unity [OnApplicationFocus](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnApplicationFocus.html) is called when the application loses or gains focus.
/// Whenever the EOSManager becomes available and active, it subscribes
1839
+
/// to [Application.quitting](https://docs.unity3d.com/ScriptReference/Application-quitting.html).
1840
+
/// The event will only run when the application is definitely closing without the ability for it to be canceled.
1841
+
/// </summary>
1842
+
void OnEnable()
1843
+
{
1844
+
Application.quitting+=OnApplicationQuitting;
1845
+
}
1846
+
1847
+
/// <summary>
1848
+
/// Whenever the EOSManager becomes inactive, it unsubscribes to
1849
+
/// to [Application.quitting](https://docs.unity3d.com/ScriptReference/Application-quitting.html).
1850
+
/// This is in case the manager is unloaded without the application ending.
1851
+
/// </summary>
1852
+
voidOnDisable()
1853
+
{
1854
+
Application.quitting-=OnApplicationQuitting;
1855
+
}
1856
+
1857
+
/// <summary>
1858
+
/// Event that should be subscribed to Application.quitting, with the event
1859
+
/// managed by <see cref="OnEnable"/> and <see cref="OnDisable"/>.
1860
+
/// This is intentionally named to be different than "OnApplicationQuit", which is a Unity Message
1861
+
/// that runs when Unity begins considering quitting.
1862
+
/// Instead, this should be subscribed to <see cref="Application.quitting"/>, which is an event
1863
+
/// that only fires when the Application is irreversably shutting down.
1864
+
/// </summary>
1865
+
voidOnApplicationQuitting()
1866
+
{
1867
+
if(ShouldShutdownOnApplicationQuit)
1868
+
{
1869
+
#if EOS_CAN_SHUTDOWN
1870
+
print($"{nameof(EOSManager)} ({nameof(OnApplicationQuitting)}): Application is quitting. {nameof(ShouldShutdownOnApplicationQuit)} is true, so the plugin is being shut down. EOS_CAN_SHUTDOWN is true, so the EOS SDK will now be shut down fully.");
1871
+
#else
1872
+
print($"{nameof(EOSManager)} ({nameof(OnApplicationQuitting)}): Application is quitting. {nameof(ShouldShutdownOnApplicationQuit)} is true, so the plugin is being shut down. EOS_CAN_SHUTDOWN is false, so the EOS SDK will not be shut down.");
1873
+
#endif
1874
+
Instance.OnShutdown();
1875
+
}
1876
+
else
1877
+
{
1878
+
print($"{nameof(EOSManager)}({nameof(OnApplicationQuitting)}): Application is quitting.{nameof(ShouldShutdownOnApplicationQuit)}is false,sothis manager will not shut down the EOS SDK.");
0 commit comments