mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
hmr unmounted : remove object from scene
This commit is contained in:
parent
fd4807a6bb
commit
816a38d1fd
@ -46,6 +46,9 @@ export default {
|
||||
this.scene.add(this.light);
|
||||
if (this.light.target) this.scene.add(this.light.target);
|
||||
},
|
||||
unmounted() {
|
||||
this.scene.remove(this.light);
|
||||
},
|
||||
render() {
|
||||
return [];
|
||||
},
|
||||
|
@ -38,6 +38,9 @@ export default {
|
||||
this.mesh.receiveShadow = this.receiveShadow;
|
||||
this.scene.add(this.mesh);
|
||||
},
|
||||
unmounted() {
|
||||
this.scene.remove(this.mesh);
|
||||
},
|
||||
render() {
|
||||
return this.$slots.default();
|
||||
},
|
||||
|
@ -23,6 +23,7 @@ export default {
|
||||
},
|
||||
unmounted() {
|
||||
if (this.geometry) this.geometry.dispose();
|
||||
if (this.mesh) this.scene.remove(this.mesh);
|
||||
},
|
||||
methods: {
|
||||
initMesh() {
|
||||
|
@ -23,6 +23,7 @@ export default {
|
||||
unmounted() {
|
||||
this.texture.dispose();
|
||||
this.material.dispose();
|
||||
this.scene.remove(this.sprite);
|
||||
},
|
||||
methods: {
|
||||
onLoaded() {
|
||||
|
Loading…
Reference in New Issue
Block a user