Merge pull request #75398 from newobj/issue-75218

Update GPUParticles2D/3D speed scale on ENTER_TREE
This commit is contained in:
Yuri Sizov 2023-03-28 16:34:58 +02:00 committed by GitHub
commit 1222d35cdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -538,6 +538,11 @@ void GPUParticles2D::_notification(int p_what) {
if (sub_emitter != NodePath()) {
_attach_sub_emitter();
}
if (can_process()) {
RS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
} else {
RS::get_singleton()->particles_set_speed_scale(particles, 0);
}
} break;
case NOTIFICATION_EXIT_TREE: {

View File

@ -439,6 +439,11 @@ void GPUParticles3D::_notification(int p_what) {
if (sub_emitter != NodePath()) {
_attach_sub_emitter();
}
if (can_process()) {
RS::get_singleton()->particles_set_speed_scale(particles, speed_scale);
} else {
RS::get_singleton()->particles_set_speed_scale(particles, 0);
}
} break;
case NOTIFICATION_EXIT_TREE: {