mirror of
https://github.com/godotengine/godot.git
synced 2024-11-26 22:23:04 +00:00
[GDNative] function to get class constructor
This commit is contained in:
parent
61a27601f7
commit
cf45f3ab4b
@ -182,6 +182,13 @@ void GDAPI *godot_native_get_userdata(godot_object *p_instance) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname) {
|
||||
ClassDB::ClassInfo *class_info = ClassDB::classes.getptr(StringName(p_classname));
|
||||
if (class_info)
|
||||
return (godot_class_constructor)class_info->creation_func;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
godot_dictionary GDAPI godot_get_global_constants() {
|
||||
godot_dictionary constants;
|
||||
godot_dictionary_new(&constants);
|
||||
|
@ -376,6 +376,10 @@ void GDAPI godot_script_register_signal(const char *p_name, const godot_signal *
|
||||
|
||||
void GDAPI *godot_native_get_userdata(godot_object *p_instance);
|
||||
|
||||
typedef godot_object *(*godot_class_constructor)();
|
||||
|
||||
godot_class_constructor GDAPI godot_get_class_constructor(const char *p_classname);
|
||||
|
||||
godot_dictionary GDAPI godot_get_global_constants();
|
||||
|
||||
////// System Functions
|
||||
|
Loading…
Reference in New Issue
Block a user