File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ void GPUParticles2D::set_lifetime(double p_lifetime) {
8181}
8282
8383void GPUParticles2D::set_one_shot (bool p_enable) {
84+ if (one_shot == p_enable) {
85+ return ;
86+ }
8487 one_shot = p_enable;
8588 RS::get_singleton ()->particles_set_one_shot (particles, one_shot);
8689
@@ -90,8 +93,11 @@ void GPUParticles2D::set_one_shot(bool p_enable) {
9093 RenderingServer::get_singleton ()->particles_restart (particles);
9194 }
9295 }
93-
94- if (!one_shot) {
96+ if (one_shot) {
97+ active = true ;
98+ emission_time = lifetime;
99+ active_time = lifetime * (2 - explosiveness_ratio);
100+ } else {
95101 set_process_internal (false );
96102 }
97103}
Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ void GPUParticles3D::set_interp_to_end(float p_interp) {
8989}
9090
9191void GPUParticles3D::set_one_shot (bool p_one_shot) {
92+ if (one_shot == p_one_shot) {
93+ return ;
94+ }
9295 one_shot = p_one_shot;
9396 RS::get_singleton ()->particles_set_one_shot (particles, one_shot);
9497
@@ -97,6 +100,11 @@ void GPUParticles3D::set_one_shot(bool p_one_shot) {
97100 RenderingServer::get_singleton ()->particles_restart (particles);
98101 }
99102 }
103+ if (one_shot) {
104+ active = true ;
105+ emission_time = lifetime;
106+ active_time = lifetime * (2 - explosiveness_ratio);
107+ }
100108}
101109
102110void GPUParticles3D::set_use_fixed_seed (bool p_use_fixed_seed) {
You can’t perform that action at this time.
0 commit comments