Change initialization to allow custom level callbacks
Now it needs a callback for each level so custom logic (like loading singletons) can be performed.
This commit is contained in:
committed by
Bastiaan Olij
parent
dfa526ce16
commit
aef0f1e248
@@ -51,12 +51,11 @@ extern "C" {
|
||||
// Initialization.
|
||||
|
||||
GDNativeBool GDN_EXPORT example_library_init(const GDNativeInterface *p_interface, const GDNativeExtensionClassLibraryPtr p_library, GDNativeInitialization *r_initialization) {
|
||||
GDNativeBool result = godot::GDExtensionBinding::init(p_interface, p_library, r_initialization);
|
||||
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
|
||||
|
||||
if (result) {
|
||||
register_example_types();
|
||||
}
|
||||
init_obj.register_scene_initializer(register_example_types);
|
||||
init_obj.register_scene_terminator(unregister_example_types);
|
||||
|
||||
return result;
|
||||
return init_obj.init();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user