Created
April 1, 2015 18:18
-
-
Save brunomikoski/1077c09c7f945a137a98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void OnEnable() | |
{ | |
Application.RegisterLogCallback(HandleUnityLog); | |
} | |
private void OnDisable() | |
{ | |
Application.RegisterLogCallback(null); | |
} | |
private void HandleUnityLog(string condition, string stacktrace, LogType type) | |
{ | |
if (type != LogType.Error && type != LogType.Exception) | |
return; | |
BackendConnectionManager.LogoutUser(); | |
ShowError(condition + "\n\nRestart the app and try again."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment