feat: hit effect scenes are now preloaded
This commit is contained in:
parent
5a4ac26c72
commit
adcbf41a48
4 changed files with 35 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue