1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 20:32:02 +08:00
trois/src/materials/Map.js

20 lines
352 B
JavaScript
Raw Normal View History

2020-10-04 06:07:10 +08:00
import Texture from '../core/Texture';
export default {
extends: Texture,
inject: ['material'],
created() {
this.material.setMap(this.texture);
},
unmounted() {
this.material.setMap(null);
},
methods: {
2020-10-04 06:20:27 +08:00
refreshTexture() {
this.createTexture();
this.material.setMap(this.texture);
},
2020-10-04 06:07:10 +08:00
},
__hmrId: 'Map',
};