@newkrok/three-particles 2.8.0 → 2.8.1

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.
package/dist/index.js CHANGED
@@ -849,6 +849,7 @@ var destroyParticleSystem = (particleSystem) => {
849
849
  else savedParticleSystem.material.dispose();
850
850
  if (savedParticleSystem.parent)
851
851
  savedParticleSystem.parent.remove(savedParticleSystem);
852
+ if (wrapper?.parent) wrapper.parent.remove(wrapper);
852
853
  return false;
853
854
  }
854
855
  );
@@ -1332,8 +1333,8 @@ var createParticleSystem = (config = DEFAULT_PARTICLE_SYSTEM_CONFIG, externalNow
1332
1333
  const cleanupCompletedInstances = (instances) => {
1333
1334
  for (let i = instances.length - 1; i >= 0; i--) {
1334
1335
  const sub = instances[i];
1335
- const points = sub.instance;
1336
- const isActiveArr = points.geometry?.attributes?.isActive?.array;
1336
+ const points = sub.instance instanceof THREE3.Points ? sub.instance : sub.instance.children[0];
1337
+ const isActiveArr = points?.geometry?.attributes?.isActive?.array;
1337
1338
  if (!isActiveArr) {
1338
1339
  sub.dispose();
1339
1340
  instances.splice(i, 1);