瀏覽代碼

Fix particles resetting properties when emitting is toggled

Qbieshay 1 月之前
父節點
當前提交
b93f6fa1ba
共有 4 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      scene/2d/cpu_particles_2d.cpp
  2. 1 1
      scene/2d/gpu_particles_2d.cpp
  3. 1 1
      scene/3d/cpu_particles_3d.cpp
  4. 1 1
      scene/3d/gpu_particles_3d.cpp

+ 1 - 1
scene/2d/cpu_particles_2d.cpp

@@ -45,7 +45,7 @@ void CPUParticles2D::set_emitting(bool p_emitting) {
 		return;
 	}
 
-	if (p_emitting && !use_fixed_seed) {
+	if (p_emitting && !use_fixed_seed && one_shot) {
 		set_seed(Math::rand());
 	}
 

+ 1 - 1
scene/2d/gpu_particles_2d.cpp

@@ -41,7 +41,7 @@
 void GPUParticles2D::set_emitting(bool p_emitting) {
 	// Do not return even if `p_emitting == emitting` because `emitting` is just an approximation.
 
-	if (p_emitting && p_emitting != emitting && !use_fixed_seed) {
+	if (p_emitting && p_emitting != emitting && !use_fixed_seed && one_shot) {
 		set_seed(Math::rand());
 	}
 	if (p_emitting && one_shot) {

+ 1 - 1
scene/3d/cpu_particles_3d.cpp

@@ -48,7 +48,7 @@ void CPUParticles3D::set_emitting(bool p_emitting) {
 		return;
 	}
 
-	if (p_emitting && !use_fixed_seed) {
+	if (p_emitting && !use_fixed_seed && one_shot) {
 		set_seed(Math::rand());
 	}
 

+ 1 - 1
scene/3d/gpu_particles_3d.cpp

@@ -42,7 +42,7 @@ AABB GPUParticles3D::get_aabb() const {
 
 void GPUParticles3D::set_emitting(bool p_emitting) {
 	// Do not return even if `p_emitting == emitting` because `emitting` is just an approximation.
-	if (p_emitting && p_emitting != emitting && !use_fixed_seed) {
+	if (p_emitting && p_emitting != emitting && !use_fixed_seed && one_shot) {
 		set_seed(Math::rand());
 	}
 	if (p_emitting && one_shot) {