diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 5d59c336361..1210ca3a308 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1497,12 +1497,24 @@ bool CSharpInstance::get(const StringName &p_name, Variant &r_ret) const { void CSharpInstance::get_property_list(List *p_properties) const { List props; - script->get_script_property_list(&props); + ERR_FAIL_COND(!script.is_valid()); +#ifdef TOOLS_ENABLED + for (const PropertyInfo &prop : script->exported_members_cache) { + props.push_back(prop); + } +#else + for (const KeyValue &E : script->member_info) { + props.push_front(E.value); + } +#endif + + for (PropertyInfo &prop : props) { + validate_property(prop); + p_properties->push_back(prop); + } // Call _get_property_list - ERR_FAIL_COND(!script.is_valid()); - StringName method = SNAME("_get_property_list"); Variant ret; @@ -1524,10 +1536,25 @@ void CSharpInstance::get_property_list(List *p_properties) const { } } - props.reverse(); - for (PropertyInfo &prop : props) { - validate_property(prop); - p_properties->push_front(prop); + CSharpScript *top = script.ptr()->base_script.ptr(); + while (top != nullptr) { + props.clear(); +#ifdef TOOLS_ENABLED + for (const PropertyInfo &prop : top->exported_members_cache) { + props.push_back(prop); + } +#else + for (const KeyValue &E : top->member_info) { + props.push_front(E.value); + } +#endif + + for (PropertyInfo &prop : props) { + validate_property(prop); + p_properties->push_back(prop); + } + + top = top->base_script.ptr(); } }