UNPKG

@tomorrowevening/hermes

Version:

An extendable set of Web Tools controlled via a separate window for non-intereference with content.

2 lines (1 loc) 714 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("three"),r=e=>{e?.dispose()},n=e=>{if(e){if(Array.isArray(e)){e.forEach(s=>n(s));return}for(const s in e){const i=e[s];i instanceof t.Texture&&r(i)}if(e.isShaderMaterial===!0){const s=e;for(const i in s.uniforms){const o=s.uniforms[i];o?.value instanceof t.Texture&&r(o.value)}}e.dispose()}},f=e=>{if(e){for(;e.children.length>0;){const s=e.children[0];s.type==="Audio"?(s.pause(),s.parent&&s.parent.remove(s)):f(s)}if(e.parent&&e.parent.remove(e),e.isMesh){const s=e;s.geometry?.dispose(),n(s.material)}typeof e.dispose=="function"&&e.dispose()}};exports.dispose=f;exports.disposeMaterial=n;exports.disposeTexture=r;