Ensure CPU particles do not process if not visible
This commit is contained in:
parent
14494dddd0
commit
328679fddd
2 changed files with 2 additions and 2 deletions
|
@ -985,7 +985,7 @@ void CPUParticles2D::_notification(int p_what) {
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
|
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
|
||||||
|
|
||||||
if (particles.size() == 0)
|
if (particles.size() == 0 || !is_visible_in_tree())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float delta = get_process_delta_time();
|
float delta = get_process_delta_time();
|
||||||
|
|
|
@ -1036,7 +1036,7 @@ void CPUParticles::_notification(int p_what) {
|
||||||
|
|
||||||
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
|
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
|
||||||
|
|
||||||
if (particles.size() == 0)
|
if (particles.size() == 0 || !is_visible_in_tree())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float delta = get_process_delta_time();
|
float delta = get_process_delta_time();
|
||||||
|
|
Loading…
Reference in a new issue