diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/particles_2d.cpp | 9 | ||||
-rw-r--r-- | scene/3d/particles.cpp | 12 | ||||
-rw-r--r-- | scene/3d/particles.h | 1 |
3 files changed, 22 insertions, 0 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index b56f4f9ad9..572195b570 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -300,6 +300,15 @@ void Particles2D::_notification(int p_what) { #endif } + if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) { + if (can_process()) { + VS::get_singleton()->particles_set_speed_scale(particles, speed_scale); + } else { + + VS::get_singleton()->particles_set_speed_scale(particles, 0); + } + } + if (p_what == NOTIFICATION_TRANSFORM_CHANGED) { _update_particle_emission_transform(); } diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index c8f45a8d7e..bab23d013b 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -266,6 +266,18 @@ void Particles::_validate_property(PropertyInfo &property) const { } } +void Particles::_notification(int p_what) { + + if (p_what == NOTIFICATION_PAUSED || p_what == NOTIFICATION_UNPAUSED) { + if (can_process()) { + VS::get_singleton()->particles_set_speed_scale(particles, speed_scale); + } else { + + VS::get_singleton()->particles_set_speed_scale(particles, 0); + } + } +} + void Particles::_bind_methods() { ClassDB::bind_method(D_METHOD("set_emitting", "emitting"), &Particles::set_emitting); diff --git a/scene/3d/particles.h b/scene/3d/particles.h index 0549eb4c09..31ca85a59a 100644 --- a/scene/3d/particles.h +++ b/scene/3d/particles.h @@ -78,6 +78,7 @@ private: protected: static void _bind_methods(); + void _notification(int p_what); virtual void _validate_property(PropertyInfo &property) const; public: |