summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/GodotTools
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-09-23 16:13:49 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-09-23 16:13:49 +0200
commitea8d20d35b5171a3ddaebad4b5649ba8f67b51c9 (patch)
tree96b6e53bf3ec13622823dea184b765a6049be156 /modules/mono/editor/GodotTools
parent8c273eb14ceeecc08f1262e7fccc8cdf260958ae (diff)
parent307224927ced54943e1ce3da393c63b35160bd2e (diff)
downloadredot-engine-ea8d20d35b5171a3ddaebad4b5649ba8f67b51c9.tar.gz
Merge pull request #96955 from Delsin-Yu/generator-based-CreateManagedForGodotObjectBinding
[.NET] Replace Reflection-Based implementation with Generated one in `CreateManagedForGodotObjectBinding`
Diffstat (limited to 'modules/mono/editor/GodotTools')
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
index e84b4e92c7..788b46ab9a 100644
--- a/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/GodotSharpEditor.cs
@@ -7,6 +7,7 @@ using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
+using System.Reflection;
using GodotTools.Build;
using GodotTools.Ides;
using GodotTools.Ides.Rider;
@@ -701,6 +702,23 @@ namespace GodotTools
private static IntPtr InternalCreateInstance(IntPtr unmanagedCallbacks, int unmanagedCallbacksSize)
{
Internal.Initialize(unmanagedCallbacks, unmanagedCallbacksSize);
+
+ var populateConstructorMethod =
+ AppDomain.CurrentDomain
+ .GetAssemblies()
+ .First(x => x.GetName().Name == "GodotSharpEditor")
+ .GetType("Godot.EditorConstructors")?
+ .GetMethod("AddEditorConstructors",
+ BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public);
+
+ if (populateConstructorMethod == null)
+ {
+ throw new MissingMethodException("Godot.EditorConstructors",
+ "AddEditorConstructors");
+ }
+
+ populateConstructorMethod.Invoke(null, null);
+
return new GodotSharpEditor().NativeInstance;
}
}