Merge pull request #60723 from reduz/refactor-module-initialization
This commit is contained in:
commit
84f64ddde9
103 changed files with 897 additions and 454 deletions
|
|
@ -34,7 +34,11 @@
|
|||
|
||||
Ref<MobileVRInterface> mobile_vr;
|
||||
|
||||
void register_mobile_vr_types() {
|
||||
void initialize_mobile_vr_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
|
||||
GDREGISTER_CLASS(MobileVRInterface);
|
||||
|
||||
if (XRServer::get_singleton()) {
|
||||
|
|
@ -43,7 +47,11 @@ void register_mobile_vr_types() {
|
|||
}
|
||||
}
|
||||
|
||||
void unregister_mobile_vr_types() {
|
||||
void uninitialize_mobile_vr_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mobile_vr.is_valid()) {
|
||||
// uninitialise our interface if it is initialised
|
||||
if (mobile_vr->is_initialized()) {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@
|
|||
#ifndef MOBILE_VR_REGISTER_TYPES_H
|
||||
#define MOBILE_VR_REGISTER_TYPES_H
|
||||
|
||||
void register_mobile_vr_types();
|
||||
void unregister_mobile_vr_types();
|
||||
#include "modules/register_module_types.h"
|
||||
|
||||
void initialize_mobile_vr_module(ModuleInitializationLevel p_level);
|
||||
void uninitialize_mobile_vr_module(ModuleInitializationLevel p_level);
|
||||
|
||||
#endif // MOBILE_VR_REGISTER_TYPES_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue