فهرست منبع

Merge pull request #10297 from leezh/fix_10181

Disabling Particles::one_shot restarts emission
Rémi Verschelde 8 سال پیش
والد
کامیت
26137f37eb
2فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 2 0
      scene/2d/particles_2d.cpp
  2. 2 0
      scene/3d/particles.cpp

+ 2 - 0
scene/2d/particles_2d.cpp

@@ -55,6 +55,8 @@ void Particles2D::set_one_shot(bool p_enable) {
 
 	one_shot = p_enable;
 	VS::get_singleton()->particles_set_one_shot(particles, one_shot);
+	if (!one_shot && emitting)
+		VisualServer::get_singleton()->particles_restart(particles);
 }
 void Particles2D::set_pre_process_time(float p_time) {
 

+ 2 - 0
scene/3d/particles.cpp

@@ -63,6 +63,8 @@ void Particles::set_one_shot(bool p_one_shot) {
 
 	one_shot = p_one_shot;
 	VS::get_singleton()->particles_set_one_shot(particles, one_shot);
+	if (!one_shot && emitting)
+		VisualServer::get_singleton()->particles_restart(particles);
 }
 
 void Particles::set_pre_process_time(float p_time) {