@galacean/engine-core 1.3.20 → 1.3.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30406,7 +30406,12 @@ exports.ParticleStopMode = void 0;
30406
30406
  };
30407
30407
  _proto._render = function _render(context) {
30408
30408
  var generator = this.generator;
30409
- generator._primitive.instanceCount = generator._getAliveParticleCount();
30409
+ // Don't need to render when no particles
30410
+ var aliveParticleCount = generator._getAliveParticleCount();
30411
+ if (!aliveParticleCount) {
30412
+ return;
30413
+ }
30414
+ generator._primitive.instanceCount = aliveParticleCount;
30410
30415
  var material = this.getMaterial();
30411
30416
  if (!material) {
30412
30417
  return;
@@ -32722,7 +32727,8 @@ __decorate([
32722
32727
  */ _proto._emit = function _emit(time, count) {
32723
32728
  if (this.emission.enabled) {
32724
32729
  // Wait the existing particles to be retired
32725
- if (this.main._maxParticleBuffer < this._currentParticleCount) {
32730
+ var notRetireParticleCount = this._getNotRetiredParticleCount();
32731
+ if (notRetireParticleCount >= this.main.maxParticles) {
32726
32732
  return;
32727
32733
  }
32728
32734
  var position = ParticleGenerator._tempVector30;
package/dist/module.js CHANGED
@@ -30401,7 +30401,12 @@ var ParticleStopMode;
30401
30401
  };
30402
30402
  _proto._render = function _render(context) {
30403
30403
  var generator = this.generator;
30404
- generator._primitive.instanceCount = generator._getAliveParticleCount();
30404
+ // Don't need to render when no particles
30405
+ var aliveParticleCount = generator._getAliveParticleCount();
30406
+ if (!aliveParticleCount) {
30407
+ return;
30408
+ }
30409
+ generator._primitive.instanceCount = aliveParticleCount;
30405
30410
  var material = this.getMaterial();
30406
30411
  if (!material) {
30407
30412
  return;
@@ -32717,7 +32722,8 @@ __decorate([
32717
32722
  */ _proto._emit = function _emit(time, count) {
32718
32723
  if (this.emission.enabled) {
32719
32724
  // Wait the existing particles to be retired
32720
- if (this.main._maxParticleBuffer < this._currentParticleCount) {
32725
+ var notRetireParticleCount = this._getNotRetiredParticleCount();
32726
+ if (notRetireParticleCount >= this.main.maxParticles) {
32721
32727
  return;
32722
32728
  }
32723
32729
  var position = ParticleGenerator._tempVector30;