summaryrefslogtreecommitdiff
path: root/modules/mono/glue/GodotSharp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/glue/GodotSharp')
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs
index 354212da1b..ccb21502c0 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs
@@ -84,12 +84,29 @@ namespace Godot.Bridge
if (godotObject == null)
throw new InvalidOperationException();
+ // Properties
if (godotObject.GetGodotClassPropertyValue(CustomUnsafe.AsRef(name), out godot_variant outRetValue))
{
*outRet = outRetValue;
return godot_bool.True;
}
+ // Signals
+ if (godotObject.HasGodotClassSignal(CustomUnsafe.AsRef(name)))
+ {
+ godot_signal signal = new godot_signal(*name, godotObject.GetInstanceId());
+ *outRet = VariantUtils.CreateFromSignalTakingOwnershipOfDisposableValue(signal);
+ return godot_bool.True;
+ }
+
+ // Methods
+ if (godotObject.HasGodotClassMethod(CustomUnsafe.AsRef(name)))
+ {
+ godot_callable method = new godot_callable(*name, godotObject.GetInstanceId());
+ *outRet = VariantUtils.CreateFromCallableTakingOwnershipOfDisposableValue(method);
+ return godot_bool.True;
+ }
+
var nameManaged = StringName.CreateTakingOwnershipOfDisposableValue(
NativeFuncs.godotsharp_string_name_new_copy(CustomUnsafe.AsRef(name)));