diff options
| author | Juan Linietsky | 2017-08-07 19:01:30 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-08-07 19:02:25 -0300 |
| commit | bb47bca1f6184abe9ee7bb8b683922ab8388123f (patch) | |
| tree | bcdf7486aa54aafbffd209ef7bf510e53dc04d58 /scene/2d | |
| parent | 1f638b206ed567b07409067d57a29de042453884 (diff) | |
| download | godot-bb47bca1f6184abe9ee7bb8b683922ab8388123f.tar.gz godot-bb47bca1f6184abe9ee7bb8b683922ab8388123f.tar.zst godot-bb47bca1f6184abe9ee7bb8b683922ab8388123f.zip | |
Ability to pause particles, closes #3675
Diffstat (limited to 'scene/2d')
| -rw-r--r-- | scene/2d/particles_2d.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index b56f4f9ad..572195b57 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(); } |
