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

20 lines
349 B
JavaScript
Raw Normal View History

2021-03-07 06:14:22 +08:00
import Texture from './Texture.js';
2020-10-04 06:07:10 +08:00
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',
};