Override Error.handler for UnityLoader
See original GitHub issueHi,
First of all thanks for this component, I’ve been using it without any problems for my game. I have a feature request. Would it be possible to override the Error.handler function on the UnityLoader object?
As described in this thread: https://forum.unity.com/threads/make-javascript-errors-not-alert-in-5-6.466772/
I’ve tried to edit the source in Unity.ts here:
this.unityContent.setUnityInstance(UnityLoader.instantiate(
ReactUnityWebGL${this.props.unityContent.uniqueID}_, this.props.unityContent.buildJsonPath, { onProgress: this.onProgress.bind(this), Module: this.props.unityContent.unityConfig.modules, width: "100%", height: "100%" })); }
But UnityLoader has no Error object here and I have zero experience in TypeScript myself. Would this be hard to implement?
Thanks.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Looks good! The error handler has 2 parameters though, the second I believe is module. I’m not using it but maybe it would be good to include it in your definition for people that want to use it.
Thanks! I’ll add it later.