diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-01 18:13:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-01 18:13:28 +0200 |
commit | 77e894768798c6d6b02759edf5774fb0cd09ac04 (patch) | |
tree | 83a3ab36515cb6995e94cce081fa4cedfff74f54 | |
parent | 3a6102a6f716904bb158819146e3fed7590b8106 (diff) | |
parent | cb4d145c22379a7ffd40965b4ba182854708c218 (diff) |
Merge pull request #30905 from clayjohn/set-cpuparticles2d-visible
Toggle CPUParticles2D visibility when redrawing
-rw-r--r-- | scene/2d/cpu_particles_2d.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 4b309a93b5..f9f273d494 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -962,9 +962,13 @@ void CPUParticles2D::_set_redraw(bool p_redraw) { if (redraw) { VS::get_singleton()->connect("frame_pre_draw", this, "_update_render_thread"); VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), true); + + VS::get_singleton()->multimesh_set_visible_instances(multimesh, -1); } else { VS::get_singleton()->disconnect("frame_pre_draw", this, "_update_render_thread"); VS::get_singleton()->canvas_item_set_update_when_visible(get_canvas_item(), false); + + VS::get_singleton()->multimesh_set_visible_instances(multimesh, 0); } #ifndef NO_THREADS update_mutex->unlock(); |