diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-08-07 19:01:30 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-08-07 19:02:25 -0300 |
commit | bb47bca1f6184abe9ee7bb8b683922ab8388123f (patch) | |
tree | bcdf7486aa54aafbffd209ef7bf510e53dc04d58 /scene/3d/particles.cpp | |
parent | 1f638b206ed567b07409067d57a29de042453884 (diff) | |
download | redot-engine-bb47bca1f6184abe9ee7bb8b683922ab8388123f.tar.gz |
Ability to pause particles, closes #3675
Diffstat (limited to 'scene/3d/particles.cpp')
-rw-r--r-- | scene/3d/particles.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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); |