toggle CPUParticles2D visibility when redrawing

(cherry picked from commit cb4d145c22)
This commit is contained in:
clayjohn 2019-07-28 18:31:52 -07:00 committed by Rémi Verschelde
parent 3689ac6c6b
commit 61ef8e98ba
1 changed files with 4 additions and 0 deletions

View File

@ -936,9 +936,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();