C#: Allow exporting games without C#

When exporting a game that contains a C# solution, a feature is added so the exported game can check if it should initialize the .NET module. Otherwise, the module initialization is skipped so games without C# won't check for the assemblies and won't show alerts when they're missing.
This commit is contained in:
Raul Santos committed 2023-10-16 05:07:11 +02:00
1 parent a574c0296b
commit be1dfd3b3a
4 files changed
+38 -12

No files matched your search

+7 -7
View File
@@ -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() {