godot-cpp-utils/spawn_point.cpp

24 lines
533 B
C++
Raw Normal View History

#include "spawn_point.hpp"
#include "utils/game_root.hpp"
namespace utils {
void SpawnPoint3D::_bind_methods() {
}
void SpawnPoint3D::_enter_tree() {
GameRoot3D *root = gd::Object::cast_to<GameRoot3D>(GameRoot3D::get_singleton());
if(root == nullptr) {
return;
}
root->register_spawn_point(this);
}
void SpawnPoint3D::_exit_tree() {
GameRoot3D *root = Object::cast_to<GameRoot3D>(GameRoot3D::get_singleton());
if(root == nullptr) {
return;
}
root->unregister_spawn_point(this);
}
}