From 4e00d8520db33de62645043af3d9d3ca83b1153f Mon Sep 17 00:00:00 2001 From: pepegadeveloper123 Date: Mon, 11 May 2020 03:20:11 +0900 Subject: Inherited C# scene not inheriting parent's fields When a child scene inherits a parent scene with a C# root node, the parent scene's export variables appear to assume values set in the parent scene, in the child scene's Inspector. However, when the child scene is played, the parent scene's export variables assume default values. When a node is created, it inherits its parent C# script's fields from the map CSharpScriptInstance::script->member_info. However this map was not initialized outside the editor, and this commit ensured it is. This fixes issues #36480 and #37581. --- modules/mono/csharp_script.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/mono/csharp_script.h') diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 05e2857538..c9ea482c36 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -147,8 +147,9 @@ private: bool _get_signal(GDMonoClass *p_class, GDMonoMethod *p_delegate_invoke, Vector ¶ms); bool _update_exports(); -#ifdef TOOLS_ENABLED + bool _get_member_export(IMonoClassMember *p_member, bool p_inspect_export, PropertyInfo &r_prop_info, bool &r_exported); +#ifdef TOOLS_ENABLED static int _try_get_member_export_hint(IMonoClassMember *p_member, ManagedType p_type, Variant::Type p_variant_type, bool p_allow_generics, PropertyHint &r_hint, String &r_hint_string); #endif -- cgit v1.2.3