Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions com.rlabrecque.steamworks.net/Runtime/CallbackDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
"noEngineReferences": true
}