godot-cpp-utils/spawn_point.cpp

24 lines
529 B
C++

#include "spawn_point.hpp"
#include "utils/game_root.hpp"
namespace godot {
void SpawnPoint3D::_bind_methods() {
}
void SpawnPoint3D::_enter_tree() {
GameRoot3D *root = 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);
}
}