From ae1ff3639598e615ae625065393ef8820c6dde78 Mon Sep 17 00:00:00 2001 From: aldelaro5 Date: Tue, 28 Jan 2025 22:44:50 -0500 Subject: [PATCH] Improve the mono init debug logic to be simplified and works on Unity 5.4 and older --- src/bootstrap.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/bootstrap.c b/src/bootstrap.c index 52f97e1..ed38f71 100644 --- a/src/bootstrap.c +++ b/src/bootstrap.c @@ -225,26 +225,11 @@ void *init_mono(const char *root_domain_name, const char *runtime_version) { } void *domain = NULL; - if (mono_is_net35) { - if (config.mono_debug_enabled && !debugger_already_enabled) { - LOG("Detected mono debugger is not initialized; initialized it"); - mono.debug_init(MONO_DEBUG_FORMAT_MONO); - } - - domain = mono.jit_init_version(root_domain_name, runtime_version); - - if (config.mono_debug_enabled && !debugger_already_enabled) { - mono.debug_domain_create(domain); - } - } else { - domain = mono.jit_init_version(root_domain_name, runtime_version); - - if (config.mono_debug_enabled && !debugger_already_enabled) { - LOG("Detected mono debugger is not initialized; initialized it"); - mono.debug_init(MONO_DEBUG_FORMAT_MONO); - mono.debug_domain_create(domain); - } + if (config.mono_debug_enabled && !debugger_already_enabled) { + LOG("Detected mono debugger is not initialized; initialized it"); + mono.debug_init(MONO_DEBUG_FORMAT_MONO); } + domain = mono.jit_init_version(root_domain_name, runtime_version); mono_doorstop_bootstrap(domain);