Is it possible to detect an error in a C# script running in Unity without reading the console log ? I need this when I have to build the game and test it in a mobile. If there is an error when running it will display a message box that shows the error.
I understand that we can use Unity Log Viewer to print all the Log in the device. But I ask for another way to do this. I ask a simpler solution. My solution I think it is a best to detect a minor errors when it runs successfully in editor, but has problems when running in a device due it just displays a showMessageBox Error.
I need to detect if something is wrong when running. I realize that there is Debug.LogError which we can detect an error. But Debug.LogError just print the message type by us to pointing what the object error is. What I need is to detect a global error like console and show error message from unity engine.
What I need may be something like :
void Update() {
showMessageBox(isErrorDetect());
}
showMessageBox => is a function to show message box.
isErrorDetect => this will print an error if detect like a console.
If someone understand what I mean, then please, give me a solution.
Thank You