- Component to enable the CRIWARE error output.
By creating this component, you can enable the notification of warnings and errors detected in CRIWARE.
Use this component only for development. Disable it when you release your application.
- [Remarks]
(*1) The CRIWARE Error Handler can also be created from the [GameObject]->[CRIWARE]->[Create CRIWARE Error Handler] menu.
In this case, it will be created as a game object.
Settings
[Force Crash on Error] check box
- If you enable this checkbox, the application will be forced to crash immediately when this component detects a CRIWARE warning or error.
This can be used to check whether there are any errors when running the app on a real device.
- Attention
- When using this function, any warnings or errors caused by this plugin will cause the Unity editor to crash.
Please disable this function when developing in the Unity editor.
[Don't Destroy On Load] check box
- If you disable this checkbox, the CRIWARE Error Handler component will be destroyed on scene change.
Basically, we recommend that you enable the check so that you can handle errors across scenes.
Replace error output with your own logging method
- For example, if you only want to see errors in debug builds: You can output your own log by using CriWare.CriErrorNotifier.OnCallbackThreadUnsafe as follows:
You can also apply this method to handle CRIWARE error notifications as part of the internal processing of an existing class.
public class CustomErrorHandler : MonoBehaviour
{
private void OnCallback(string message)
{
#if DEVELOPMENT_BUILD || UNITY_EDITOR
if (message.StartsWith("E"))
Debug.LogError("Error:" + message);
else if (message.StartsWith("W"))
Debug.LogWarning("Warning:" + message);
else
Debug.Log(message);
#endif
}
}
- Attention
- If you prepare your own log output component like the one above, please be sure to delete the standard Error Handler component.
THIS SERVICE MAY CONTAIN TRANSLATIONS POWERED BY GOOGLE. GOOGLE DISCLAIMS ALL WARRANTIES RELATED TO THE TRANSLATIONS, EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OF ACCURACY, RELIABILITY, AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.