diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-05 08:27:16 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-05 08:27:16 +0200 |
commit | 785ce4208db2b64e78ebd90c33d00a7fe04fc01b (patch) | |
tree | 19cfdb8ea594c43476fd37dd7255b5b640fcce9d /modules/mono/glue/GodotSharp | |
parent | 99430dc4cd7b751292a116a456d812dc5fdbc9bb (diff) | |
parent | a91a3d01f849ba3a7c1615003f8f11ca824d3d58 (diff) |
Merge pull request #65266 from raulsntos/dotnet/reload-non-tool-scripts
Create script instance of reloaded scripts even if they're not tools
Diffstat (limited to 'modules/mono/glue/GodotSharp')
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs index 3884781988..092724a6b1 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/ScriptManagerBridge.cs @@ -130,7 +130,6 @@ namespace Godot.Bridge { // Performance is not critical here as this will be replaced with source generators. Type scriptType = _scriptTypeBiMap.GetScriptType(scriptPtr); - var obj = (Object)FormatterServices.GetUninitializedObject(scriptType); var ctor = scriptType .GetConstructors(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance) @@ -151,6 +150,8 @@ namespace Godot.Bridge } } + var obj = (Object)FormatterServices.GetUninitializedObject(scriptType); + var parameters = ctor.GetParameters(); int paramCount = parameters.Length; |