diff --git a/SteamManager.cs b/SteamManager.cs index 3c369e2..99dc379 100644 --- a/SteamManager.cs +++ b/SteamManager.cs @@ -141,6 +141,18 @@ protected virtual void OnEnable() { m_SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook); SteamClient.SetWarningMessageHook(m_SteamAPIWarningMessageHook); } + + CallbackDispatcher.OnSteamExceptionEvent += OnSteamException; + } + + protected virtual void OnDisable() + { + CallbackDispatcher.OnSteamExceptionEvent -= OnSteamException; + } + + public static void OnSteamException(System.Exception e) + { + Debug.LogException(e); } // OnApplicationQuit gets called too early to shutdown the SteamAPI.