diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-08-13 17:25:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-13 17:25:58 +0200 |
commit | 26137f37ebb4ddf005950b1ebd0c153738bd7fed (patch) | |
tree | 2298f9bdb303e40577d9b7584e2ed5377859878b | |
parent | 0e81053de80764830246b3faff30d3418e9d895a (diff) | |
parent | a625d7edfc60255f019186fabe7f34eb5438295c (diff) |
Merge pull request #10297 from leezh/fix_10181
Disabling Particles::one_shot restarts emission
-rw-r--r-- | scene/2d/particles_2d.cpp | 2 | ||||
-rw-r--r-- | scene/3d/particles.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 4aa841131a..a2ec33f403 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -55,6 +55,8 @@ void Particles2D::set_one_shot(bool p_enable) { one_shot = p_enable; VS::get_singleton()->particles_set_one_shot(particles, one_shot); + if (!one_shot && emitting) + VisualServer::get_singleton()->particles_restart(particles); } void Particles2D::set_pre_process_time(float p_time) { diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 081caf4419..d83469da62 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -63,6 +63,8 @@ void Particles::set_one_shot(bool p_one_shot) { one_shot = p_one_shot; VS::get_singleton()->particles_set_one_shot(particles, one_shot); + if (!one_shot && emitting) + VisualServer::get_singleton()->particles_restart(particles); } void Particles::set_pre_process_time(float p_time) { |