From a625d7edfc60255f019186fabe7f34eb5438295c Mon Sep 17 00:00:00 2001 From: Zher Huei Lee Date: Sat, 12 Aug 2017 16:13:29 +0800 Subject: Disabling Particles::one_shot restarts emission Fixes #10181 --- scene/2d/particles_2d.cpp | 2 ++ scene/3d/particles.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'scene') 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) { -- cgit v1.2.3