diff --git a/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs b/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs index f27be5ea..7b02f554 100644 --- a/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs +++ b/com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs @@ -34,10 +34,16 @@ public static class CallbackDispatcher { // We catch exceptions inside callbacks and reroute them here. // For some reason throwing an exception causes RunCallbacks() to break otherwise. // If you have a custom ExceptionHandler in your engine you can register it here manually until we get something more elegant hooked up. + + public delegate void OnSteamException(Exception e); + public static OnSteamException OnSteamExceptionEvent; + public static void ExceptionHandler(Exception e) { -#if UNITY_STANDALONE - UnityEngine.Debug.LogException(e); -#elif STEAMWORKS_WIN || STEAMWORKS_LIN_OSX + if(OnSteamExceptionEvent != null) { + OnSteamExceptionEvent.Invoke(e); + } + +#if STEAMWORKS_WIN || STEAMWORKS_LIN_OSX Console.WriteLine(e.Message); #endif } diff --git a/com.rlabrecque.steamworks.net/Runtime/com.rlabrecque.steamworks.net.asmdef b/com.rlabrecque.steamworks.net/Runtime/com.rlabrecque.steamworks.net.asmdef index 2692f320..e232ab70 100644 --- a/com.rlabrecque.steamworks.net/Runtime/com.rlabrecque.steamworks.net.asmdef +++ b/com.rlabrecque.steamworks.net/Runtime/com.rlabrecque.steamworks.net.asmdef @@ -16,5 +16,5 @@ "autoReferenced": true, "defineConstraints": [], "versionDefines": [], - "noEngineReferences": false + "noEngineReferences": true } \ No newline at end of file