@@ -201,21 +201,21 @@ bool useNativeLibAndroid
201201 throw new ArgumentException ( "BugSplat error: version cannot be null or empty" ) ;
202202 }
203203
204- #if UNITY_STANDALONE_WIN || UNITY_WSA
205-
204+ var gameObject = new GameObject ( ) ;
205+
206+ #if UNITY_STANDALONE_WIN || UNITY_WSA
206207 var bugsplat = new BugSplatDotNetStandard . BugSplat ( database , application , version ) ;
207208 bugsplat . MinidumpType = BugSplatDotNetStandard . BugSplat . MinidumpTypeId . UnityNativeWindows ;
208209 bugsplat . ExceptionType = BugSplatDotNetStandard . BugSplat . ExceptionTypeId . Unity ;
209210 var dotNetStandardClientSettings = new DotNetStandardClientSettingsRepository ( bugsplat ) ;
210211 var dotNetStandardClient = new DotNetStandardClient ( bugsplat ) ;
211- var dotNetStandardExceptionReporter = new DotNetStandardExceptionReporter ( dotNetStandardClientSettings , dotNetStandardClient ) ;
212+ var dotNetStandardExceptionReporter = DotNetStandardExceptionReporter . Create ( dotNetStandardClientSettings , dotNetStandardClient , gameObject ) ;
212213 var windowsReporter = new WindowsReporter ( dotNetStandardClientSettings , dotNetStandardExceptionReporter , dotNetStandardClient ) ;
213214
214215 clientSettings = dotNetStandardClientSettings ;
215216 exceptionReporter = windowsReporter ;
216217 nativeCrashReporter = windowsReporter ;
217218#elif UNITY_WEBGL
218- var gameObject = new GameObject ( ) ;
219219 var webGLClientSettings = new WebGLClientSettingsRepository ( ) ;
220220 var webGLExceptionClient = new WebGLExceptionClient ( database , application , version ) ;
221221 var webGLReporter = WebGLReporter . Create (
@@ -241,21 +241,19 @@ bool useNativeLibAndroid
241241 javaClass . CallStatic ( "initBugSplat" , activity , database , application , version ) ;
242242 }
243243
244- UseDotNetHandler ( database , application , version ) ;
244+ UseDotNetHandler ( database , application , version , gameObject ) ;
245245#else
246- UseDotNetHandler ( database , application , version ) ;
246+ UseDotNetHandler ( database , application , version , gameObject ) ;
247247#endif
248248 }
249249
250- private void UseDotNetHandler ( string database , string application , string version )
250+ private void UseDotNetHandler ( string database , string application , string version , GameObject gameObject )
251251 {
252252 var bugsplat = new BugSplatDotNetStandard . BugSplat ( database , application , version )
253253 {
254254 MinidumpType = BugSplatDotNetStandard . BugSplat . MinidumpTypeId . UnityNativeWindows ,
255255 ExceptionType = BugSplatDotNetStandard . BugSplat . ExceptionTypeId . Unity
256256 } ;
257-
258- var gameObject = new GameObject ( ) ;
259257 var dotNetStandardClientSettings = new DotNetStandardClientSettingsRepository ( bugsplat ) ;
260258 var dotNetStandardClient = new DotNetStandardClient ( bugsplat ) ;
261259 var dotNetStandardExceptionReporter = DotNetStandardExceptionReporter . Create ( dotNetStandardClientSettings , dotNetStandardClient , gameObject ) ;
0 commit comments