MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / clear

Method clear

src/content/TextAnimations/ASCIIText/ASCIIText.jsx:369–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367 }
368
369 clear() {
370 this.scene.traverse(obj => {
371 if (obj.isMesh && typeof obj.material === 'object' && obj.material !== null) {
372 Object.keys(obj.material).forEach(key => {
373 const matProp = obj.material[key];
374 if (matProp !== null && typeof matProp === 'object' && typeof matProp.dispose === 'function') {
375 matProp.dispose();
376 }
377 });
378 obj.material.dispose();
379 obj.geometry.dispose();
380 }
381 });
382 this.scene.clear();
383 }
384
385 dispose() {
386 cancelAnimationFrame(this.animationFrameId);

Callers 2

disposeMethod · 0.95
FallingTextFunction · 0.45

Calls 1

disposeMethod · 0.45

Tested by

no test coverage detected