2024-03-13 15:08:37 +00:00
|
|
|
#include "spawn_point.hpp"
|
|
|
|
#include "utils/game_root.hpp"
|
|
|
|
|
2024-05-28 14:28:36 +00:00
|
|
|
namespace utils {
|
2024-03-13 15:08:37 +00:00
|
|
|
void SpawnPoint3D::_bind_methods() {
|
|
|
|
}
|
|
|
|
|
|
|
|
void SpawnPoint3D::_enter_tree() {
|
2024-05-28 14:28:36 +00:00
|
|
|
GameRoot3D *root = gd::Object::cast_to<GameRoot3D>(GameRoot3D::get_singleton());
|
2024-03-13 15:08:37 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|