mirror of
https://github.com/godotengine/godot.git
synced 2025-02-17 22:43:01 +08:00
Fix resetting of CPUParticles (2D and 3D)
This commit is contained in:
parent
362b42787b
commit
c13ac398f6
@ -574,7 +574,7 @@ void CPUParticles2D::_particles_process(float p_delta) {
|
||||
if (restart_time >= prev_time && restart_time < time) {
|
||||
restart = true;
|
||||
if (fractional_delta) {
|
||||
local_delta = (time - restart_time) * lifetime;
|
||||
local_delta = time - restart_time;
|
||||
}
|
||||
}
|
||||
|
||||
@ -582,13 +582,13 @@ void CPUParticles2D::_particles_process(float p_delta) {
|
||||
if (restart_time >= prev_time) {
|
||||
restart = true;
|
||||
if (fractional_delta) {
|
||||
local_delta = (lifetime - restart_time + time) * lifetime;
|
||||
local_delta = lifetime - restart_time + time;
|
||||
}
|
||||
|
||||
} else if (restart_time < time) {
|
||||
restart = true;
|
||||
if (fractional_delta) {
|
||||
local_delta = (time - restart_time) * lifetime;
|
||||
local_delta = time - restart_time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ void CPUParticles::_particles_process(float p_delta) {
|
||||
if (restart_time >= prev_time && restart_time < time) {
|
||||
restart = true;
|
||||
if (fractional_delta) {
|
||||
local_delta = (time - restart_time) * lifetime;
|
||||
local_delta = time - restart_time;
|
||||
}
|
||||
}
|
||||
|
||||
@ -552,13 +552,13 @@ void CPUParticles::_particles_process(float p_delta) {
|
||||
if (restart_time >= prev_time) {
|
||||
restart = true;
|
||||
if (fractional_delta) {
|
||||
local_delta = (1.0 - restart_time + time) * lifetime;
|
||||
local_delta = lifetime - restart_time + time;
|
||||
}
|
||||
|
||||
} else if (restart_time < time) {
|
||||
restart = true;
|
||||
if (fractional_delta) {
|
||||
local_delta = (time - restart_time) * lifetime;
|
||||
local_delta = time - restart_time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user