diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-03-14 19:20:17 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2020-03-17 16:30:04 +0100 |
commit | 6a85cdf640d735b1ca8216b4c6e16fb949f4d183 (patch) | |
tree | afc06540f53d6d2f7ede36fc8383330dee149262 /modules/mono/mono_gd/gd_mono_internals.cpp | |
parent | 0159787864e7ecce60a4d3142f5c82e024710f89 (diff) |
Fix C# bindings after recent breaking changes
Implementation for new Variant types Callable, Signal, StringName.
Added support for PackedInt64Array and PackedFloat64Array.
Add generation of signal members as events, as well as support for
user created signals as events.
NOTE: As of now, raising such events will not emit the signal. As such,
one must use `EmitSignal` instead of raising the event directly.
Removed old ThreadLocal fallback class. It's safe to use thread_local now since
it's supported on all minimum versions of compilers we support.
Diffstat (limited to 'modules/mono/mono_gd/gd_mono_internals.cpp')
-rw-r--r-- | modules/mono/mono_gd/gd_mono_internals.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/mono/mono_gd/gd_mono_internals.cpp b/modules/mono/mono_gd/gd_mono_internals.cpp index b179b484f3..f343a1d646 100644 --- a/modules/mono/mono_gd/gd_mono_internals.cpp +++ b/modules/mono/mono_gd/gd_mono_internals.cpp @@ -33,7 +33,6 @@ #include "../csharp_script.h" #include "../mono_gc_handle.h" #include "../utils/macros.h" -#include "../utils/thread_local.h" #include "gd_mono_class.h" #include "gd_mono_marshal.h" #include "gd_mono_utils.h" @@ -108,9 +107,11 @@ void tie_managed_to_unmanaged(MonoObject *managed, Object *unmanaged) { CRASH_COND(script.is_null()); - ScriptInstance *si = CSharpInstance::create_for_managed_type(unmanaged, script.ptr(), gchandle); + CSharpInstance *csharp_instance = CSharpInstance::create_for_managed_type(unmanaged, script.ptr(), gchandle); - unmanaged->set_script_and_instance(script, si); + unmanaged->set_script_and_instance(script, csharp_instance); + + csharp_instance->connect_event_signals(); } void unhandled_exception(MonoException *p_exc) { |