feat: hit effect scenes are now preloaded

This commit is contained in:
Sara 2025-07-28 22:21:16 +02:00
parent 5a4ac26c72
commit adcbf41a48
4 changed files with 35 additions and 4 deletions

View file

@ -8,6 +8,21 @@ void Hitbox::_bind_methods() {
BIND_HPROPERTY(Variant::OBJECT, impact_effect, PROPERTY_HINT_RESOURCE_TYPE, "PackedScene");
}
void Hitbox::_notification(int what) {
if (Engine::get_singleton()->is_editor_hint()) {
return;
}
switch (what) {
default:
return;
case NOTIFICATION_READY:
if (this->impact_effect.is_valid()) {
PRELOAD_SCENE(this->impact_effect);
}
return;
}
}
void Hitbox::set_health(HealthStatus *value) {
this->health = value;
}