1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Mono: Make use of ClassInfo's exposed API

- BindingsGenerator only generates exposed classes.
- Fix creation of managed instances of non-exposed classes.
This commit is contained in:
Ignacio Etcheverry
2017-10-09 23:50:06 +02:00
parent 0c2e882210
commit 9b6f65af82
2 changed files with 13 additions and 15 deletions

View File

@@ -654,6 +654,13 @@ void *CSharpLanguage::alloc_instance_binding_data(Object *p_object) {
StringName type_name = p_object->get_class_name();
// ¯\_(ツ)_/¯
const ClassDB::ClassInfo *classinfo = ClassDB::classes.getptr(type_name);
while (classinfo && !classinfo->exposed)
classinfo = classinfo->inherits_ptr;
ERR_FAIL_NULL_V(classinfo, NULL);
type_name = classinfo->name;
GDMonoClass *type_class = GDMonoUtils::type_get_proxy_class(type_name);
ERR_FAIL_NULL_V(type_class, NULL);