diff --git a/cocos/2d/CCParticleSystemQuad.cpp b/cocos/2d/CCParticleSystemQuad.cpp index fca8bf59e9..ab14d1e8e4 100644 --- a/cocos/2d/CCParticleSystemQuad.cpp +++ b/cocos/2d/CCParticleSystemQuad.cpp @@ -527,6 +527,7 @@ void ParticleSystemQuad::setTotalParticles(int tp) _totalParticles = tp; } + _emissionRate = _totalParticles / _life; resetSystem(); } diff --git a/tests/test-cpp/Classes/ParticleTest/ParticleTest.cpp b/tests/test-cpp/Classes/ParticleTest/ParticleTest.cpp index 35b64fa0e1..bf1480b1a9 100644 --- a/tests/test-cpp/Classes/ParticleTest/ParticleTest.cpp +++ b/tests/test-cpp/Classes/ParticleTest/ParticleTest.cpp @@ -1905,7 +1905,6 @@ void Issue3990::onEnter() _emitter->setPositionType(ParticleSystem::PositionType::GROUPED); _emitter->setTotalParticles(1000); - _emitter->setLife(20); _emitter->setPosition(VisibleRect::center());