/**************************************************************************/
/*  register_types.cpp                                                    */
/**************************************************************************/

#include "register_types.h"

#include "core/object/class_db.h"
#include "studio_bridge.h"

static StudioBridge *studio_bridge_singleton = nullptr;

void initialize_studio_bridge_module(ModuleInitializationLevel p_level) {
	if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
		return;
	}

	GDREGISTER_CLASS(StudioBridge);

	studio_bridge_singleton = memnew(StudioBridge);
	Engine::get_singleton()->add_singleton(Engine::Singleton("StudioBridge", StudioBridge::get_singleton()));
}

void uninitialize_studio_bridge_module(ModuleInitializationLevel p_level) {
	if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
		return;
	}

	if (studio_bridge_singleton) {
		memdelete(studio_bridge_singleton);
		studio_bridge_singleton = nullptr;
	}
}
