summaryrefslogtreecommitdiff
path: root/modules/mono/glue/GodotSharp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-05 08:27:16 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-05 08:27:16 +0200
commit785ce4208db2b64e78ebd90c33d00a7fe04fc01b (patch)
tree19cfdb8ea594c43476fd37dd7255b5b640fcce9d /modules/mono/glue/GodotSharp
parent99430dc4cd7b751292a116a456d812dc5fdbc9bb (diff)
parenta91a3d01f849ba3a7c1615003f8f11ca824d3d58 (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.cs3
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;