diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-16 10:43:49 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-16 10:43:49 +0200 |
commit | 5fb9ff9986a8597c3afc0a0eec92da312c3811f5 (patch) | |
tree | bd418d0b5f4e2ea28979f4499b0e888a1ddad129 /modules/mono/csharp_script.cpp | |
parent | aa0be93a89b93a04be1fbc01ca89302fddb33df7 (diff) | |
parent | be1dfd3b3ab53b5ea6678b1ca974864385e55272 (diff) | |
download | redot-engine-5fb9ff9986a8597c3afc0a0eec92da312c3811f5.tar.gz |
Merge pull request #83422 from raulsntos/dotnet/export-projects-without-csharp
C#: Allow exporting games without C#
Diffstat (limited to 'modules/mono/csharp_script.cpp')
-rw-r--r-- | modules/mono/csharp_script.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 23d0eb8b67..44bcd4cfe4 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -121,16 +121,16 @@ void CSharpLanguage::init() { GLOBAL_DEF(PropertyInfo(Variant::INT, "dotnet/project/assembly_reload_attempts", PROPERTY_HINT_RANGE, "1,16,1,or_greater"), 3); #endif - gdmono = memnew(GDMono); - gdmono->initialize(); - #ifdef TOOLS_ENABLED - if (gdmono->is_runtime_initialized()) { - gdmono->initialize_load_assemblies(); - } - EditorNode::add_init_callback(&_editor_init_callback); #endif + + gdmono = memnew(GDMono); + + // Initialize only if the project uses C#. + if (gdmono->should_initialize()) { + gdmono->initialize(); + } } void CSharpLanguage::finish() { |